Classes and utilities for working with concurrency.
These classes are included in the complete Tuweni distribution, or separately when using the gradle dependency org.apache.tuweni:tuweni-concurrent
(tuweni-concurrent.jar
).
interface AsyncCompletion
A completion that will be complete at a future time. |
|
interface AsyncResult<T : Any>
A result that will be available at a future time. |
|
class AtomicSlotMap<K : Comparable<Any?>, V : Any>
An atomic map that locates available keys within a DiscreteDomain. This is an atomic map that will allocate key slots based on availability. It will attempt to keep the range compact by filling slots as they become available. This implementation should be used with small sets, as addition is an O(N) operation. |
|
interface CompletableAsyncCompletion : AsyncCompletion
An AsyncCompletion that can later be completed successfully or with a provided exception. |
|
interface CompletableAsyncResult<T : Any> : AsyncResult<T>
An AsyncResult that can be later completed successfully with a provided value, or completed with an exception. |
|
class ExpiringMap<K : Any, V : Any> : MutableMap<K, V>
A concurrent hash map that stores values along with an expiry. Values are stored in the map until their expiry is reached, after which they will no longer be available and will appear as if removed. The actual removal is done lazily whenever the map is accessed, or when the |
|
class ExpiringSet<E : Any> : MutableSet<E>
A concurrent hash set that stores values along with an expiry. Elements are stored in the set until their expiry is reached, after which they will no longer be available and will appear as if removed. The actual removal is done lazily whenever the set is accessed, or when the |