A Hub[A] is a concurrent data structure that allows multiple publishers to
publish A values and multiple subscribers to poll A values with the
guarantee that all subscribers will receive all values published to the hub
while they are subscribed.
A MutableConcurrentQueue interface to use under the hood in ZIO.
A MutableConcurrentQueue interface to use under the hood in ZIO.
The implementation at minimum:
this is declared as abstract class since invokevirtual is slightly
cheaper than invokeinterface.
See zio.internal.RingBuffer for details on design, tradeoffs, etc.
This can be used whenever an arbitrary number of unique keys needs to be generated as this will just use memory location for equality.
A WeakConcurrentBag stores a collection of values, each wrapped in a
WeakReference.
A WeakConcurrentBag stores a collection of values, each wrapped in a
WeakReference. The structure is optimized for addition, and will achieve
zero allocations in the happy path (aside from the allocation of the
WeakReference, which is unavoidable). To remove a value from the bag, it is
sufficient to clear the corresponding weak reference, at which point the weak
reference will be removed from the bag during the next garbage collection.
Garbage collection happens regularly during the add operation. Assuming
uniform distribution of hash codes of values added to the bag, the chance of
garbage collection occurring during an add operation is 1/n, where n is
the capacity of the table backing the bag.
(Since version 2.0.0) use Executor
(Since version 2.0.0) use RuntimeConfig
A List data type that tries to avoid allocating by special-casing the
singleton list and preventing pattern matching.
Returns an effect that models success with the specified value.
Lifts an eager, pure value into a Managed.
Returns an STM effect that succeeds with the specified value.
(Since version 2.0.0) use Executor