zio.internal
Type members
Classlikes
A List data type that tries to avoid allocating by special-casing the
singleton list and preventing pattern matching.
A List data type that tries to avoid allocating by special-casing the
singleton list and preventing pattern matching.
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 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.
- Companion:
- object
See zio.internal.RingBuffer for details on design, tradeoffs, etc.
See zio.internal.RingBuffer for details on design, tradeoffs, etc.
- Companion:
- object
This can be used whenever an arbitrary number of unique keys needs to be generated as this will just use memory location for equality.
This can be used whenever an arbitrary number of unique keys needs to be generated as this will just use memory location for equality.
- Companion:
- object
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.
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.
- Companion:
- object