| Constructor and Description |
|---|
FullDrainMpscQueue(int capacity) |
| Modifier and Type | Method and Description |
|---|---|
int |
capacity() |
void |
drain(org.jctools.queues.MessagePassingQueue.Consumer<T> consumer)
The
MpscArrayQueue.drain(MessagePassingQueue.Consumer) method may skip items with allocated slots
by producers (who won CAS) but were not added to the queue yet. |
boolean |
offer(T element) |
int |
size() |
public void drain(org.jctools.queues.MessagePassingQueue.Consumer<T> consumer)
MpscArrayQueue.drain(MessagePassingQueue.Consumer) method may skip items with allocated slots
by producers (who won CAS) but were not added to the queue yet. This may happen to broken elements chain.
See explanation at http://psy-lob-saw.blogspot.com/2014/07/poll-me-maybe.html
This is an alternative approach which waits for all items to become available
by using MpscArrayQueue.poll() underneath (which spin-waits when getting next item).