Class FullDrainMpscQueue<T>
- java.lang.Object
-
- pl.allegro.tech.hermes.consumers.queue.FullDrainMpscQueue<T>
-
-
Constructor Summary
Constructors Constructor Description FullDrainMpscQueue(int capacity)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcapacity()voiddrain(org.jctools.queues.MessagePassingQueue.Consumer<T> consumer)TheMpscArrayQueue.drain(MessagePassingQueue.Consumer)method may skip items with allocated slots by producers (who won CAS) but were not added to the queue yet.booleanoffer(T element)intsize()
-
-
-
Method Detail
-
drain
public 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. This may happen to broken elements chain. See explanation here.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).
-
-