public static final class ConcurrentQueueFactory.GenericQueue<E> extends ConcurrentLinkedQueue<E> implements ConcurrentQueue<E>, ConcurrentQueueConsumer<E>, ConcurrentQueueProducer<E>
Constructor and Description |
---|
GenericQueue() |
Modifier and Type | Method and Description |
---|---|
int |
capacity() |
int |
consume(ConsumerFunction<E> consumer,
int batchSize)
As many elements as are visible are delivered to the
Consumer . |
ConcurrentQueueConsumer<E> |
consumer() |
int |
produce(ProducerFunction<E> producer,
int batchSize) |
ConcurrentQueueProducer<E> |
producer() |
boolean |
weakOffer(E e) |
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.
|
add, addAll, contains, isEmpty, iterator, offer, peek, poll, remove, size, spliterator, toArray, toArray
clear, element, remove
containsAll, removeAll, retainAll, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
size
clear, peek, poll
offer
clear, containsAll, equals, hashCode, parallelStream, removeAll, removeIf, retainAll, stream
public ConcurrentQueueConsumer<E> consumer()
consumer
in interface ConcurrentQueue<E>
public ConcurrentQueueProducer<E> producer()
producer
in interface ConcurrentQueue<E>
public int capacity()
capacity
in interface ConcurrentQueue<E>
public int produce(ProducerFunction<E> producer, int batchSize)
produce
in interface ConcurrentQueueProducer<E>
public int consume(ConsumerFunction<E> consumer, int batchSize)
ConcurrentQueueConsumer
Consumer
.consume
in interface ConcurrentQueueConsumer<E>
batchSize
- this is the limit on the batch consume operation, but it is possible that less are availablepublic boolean weakOffer(E e)
weakOffer
in interface ConcurrentQueueProducer<E>
public E weakPoll()
ConcurrentQueueConsumer
weakPoll
in interface ConcurrentQueueConsumer<E>
public E weakPeek()
ConcurrentQueueConsumer
weakPeek
in interface ConcurrentQueueConsumer<E>
Copyright © 2013–2020. All rights reserved.