public interface Pipe<E>
Modifier and Type | Method and Description |
---|---|
long |
addedCount()
The number of items added to this container since creation.
|
int |
capacity()
The maximum capacity of this container to hold items.
|
int |
drain(java.util.function.Consumer<E> elementConsumer)
Drain the number of elements present in a collection at the time the operation starts.
|
int |
drain(java.util.function.Consumer<E> elementConsumer,
int limit)
Drain the minimum of a limit and the number of elements present in a collection at the time the operation starts.
|
int |
drainTo(java.util.Collection<? super E> target,
int limit)
Drain available elements into the provided
Collection up to a provided maximum limit of
elements. |
int |
remainingCapacity()
Get the remaining capacity for elements in the container given the current size.
|
long |
removedCount()
The number of items removed from this container since creation.
|
int |
size()
The number of items currently in the container.
|
long addedCount()
long removedCount()
int capacity()
int size()
int remainingCapacity()
int drain(java.util.function.Consumer<E> elementConsumer)
If possible, implementations should use smart batching to best handle burst traffic.
elementConsumer
- Consumer
for processing elementsint drain(java.util.function.Consumer<E> elementConsumer, int limit)
If possible, implementations should use smart batching to best handle burst traffic.
elementConsumer
- Consumer
for processing elementslimit
- maximum number of elements to be drained in a drain operation.int drainTo(java.util.Collection<? super E> target, int limit)
Collection
up to a provided maximum limit of
elements.
If possible, implementations should use smart batching to best handle burst traffic.
target
- in to which elements are drained.limit
- maximum number of elements to be drained in a drain operation.Copyright © 2014-2018 Real Logic Ltd. All Rights Reserved.