final class Consumer<E> extends ConsumerFields<E> implements ConcurrentQueueConsumer<E>
| Modifier and Type | Field and Description |
|---|---|
(package private) long |
p00 |
(package private) long |
p01 |
(package private) long |
p02 |
(package private) long |
p03 |
(package private) long |
p04 |
(package private) long |
p05 |
(package private) long |
p06 |
(package private) long |
p07 |
(package private) long |
p10 |
(package private) long |
p11 |
(package private) long |
p12 |
(package private) long |
p13 |
(package private) long |
p14 |
(package private) long |
p15 |
(package private) long |
p16 |
(package private) long |
p17 |
head, HEAD_OFFSETbuffer, BUFFER_PAD, mask, SPARSE_SHIFT| Constructor and Description |
|---|
Consumer(ConcurrentCircularArray<E> c) |
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Remove all elements from the queue.
|
int |
consume(ConsumerFunction<E> c,
int batch)
As many elements as are visible are delivered to the
Consumer. |
(package private) long |
getHeadForSize() |
private long |
lvHead() |
E |
peek()
See
Queue.peek() for contract. |
E |
poll()
See
Queue.poll() for contract. |
private void |
soHead(long newHead) |
E |
weakPeek()
Return the next element from the queue, but don't remove it.
|
E |
weakPoll()
Remove the next element from the queue and return it.
|
calcOffset, calcOffset, lpElement, lpElement, lvElement, lvElement, soElement, soElement, spElement, spElement, svElement, svElementlong p00
long p01
long p02
long p03
long p04
long p05
long p06
long p07
long p10
long p11
long p12
long p13
long p14
long p15
long p16
long p17
Consumer(ConcurrentCircularArray<E> c)
public E poll()
ConcurrentQueueConsumerQueue.poll() for contract.poll in interface ConcurrentQueueConsumer<E>public E peek()
ConcurrentQueueConsumerQueue.peek() for contract.peek in interface ConcurrentQueueConsumer<E>public void clear()
ConcurrentQueueConsumerclear in interface ConcurrentQueueConsumer<E>long getHeadForSize()
private long lvHead()
private void soHead(long newHead)
public int consume(ConsumerFunction<E> c, int batch)
ConcurrentQueueConsumerConsumer.consume in interface ConcurrentQueueConsumer<E>batch - this is the limit on the batch consume operation, but it is possible that less are availablepublic E weakPoll()
ConcurrentQueueConsumerweakPoll in interface ConcurrentQueueConsumer<E>public E weakPeek()
ConcurrentQueueConsumerweakPeek in interface ConcurrentQueueConsumer<E>