K - the type of the conflation keyV - the type of values in the queue@FunctionalInterface public static interface ExchangeConflationQueue.ExchangePoller<K,V> extends ConflationQueue.Poller<K,V>
| Modifier and Type | Method and Description |
|---|---|
default V |
poll(java.util.function.BiConsumer<? super K,? super V> consumer)
Polls the queue passing a consumer which is invoked with conflation key and polled value if the queue was
non-empty.
|
V |
poll(java.util.function.BiConsumer<? super K,? super V> consumer,
V exchange)
Polls the queue passing an unused value in exchange to the queue.
|
default V |
poll(V exchange)
Polls the queue passing an unused value in exchange to the queue.
|
pollV poll(java.util.function.BiConsumer<? super K,? super V> consumer, V exchange)
If polling was successful, the exchange value will at some point be returned by an enqueue operation with the same conflation key and can be reused by the producer. The caller retains ownership of the exchange value if polling failed and null was returned.
consumer - consumer for conflation key and polled valueexchange - a value offered in exchange for the polled value, to be returned by an enqueue operationdefault V poll(V exchange)
If polling was successful, the exchange value will at some point be returned by an enqueue operation with the same conflation key and can be reused by the producer. The caller retains ownership of the exchange value if polling failed and null was returned.
exchange - a value offered in exchange for the polled value, to be returned by an enqueue operationdefault V poll(java.util.function.BiConsumer<? super K,? super V> consumer)
ConflationQueue.Pollerpoll in interface ConflationQueue.Poller<K,V>consumer - consumer for conflation key and polled value