K
- the type of the conflation keyV
- the type of values in the queuepublic interface ConflationQueue<K,V>
Modifier and Type | Interface and Description |
---|---|
static interface |
ConflationQueue.Appender<K,V>
Appender used by the producer to enqueue values.
|
static interface |
ConflationQueue.Poller<K,V>
Poller object used by the consumer to poll values.
|
Modifier and Type | Method and Description |
---|---|
ConflationQueue.Appender<K,V> |
appender()
Returns the appender object used by the producer to enqueue values.
|
ConflationQueue.Poller<K,V> |
poller()
Returns the poller object used by the consumer to poll values.
|
int |
size()
Returns the number of elements in this queue.
|
ConflationQueue.Appender<K,V> appender()
ConflationQueue.Poller<K,V> poller()
int size()
Beware that, unlike in most collections, this method may NOT be a constant-time operation. Because of the asynchronous nature of concurrent queues, determining the current number of elements may require an O(n) traversal. Additionally, if elements are added or removed during execution of this method, the returned result may be inaccurate. Thus, this method is typically not very useful in concurrent applications.