public class RedisBlockingQueue extends NuxeoBlockingQueue
BlockingQueue
.
It has unlimited capacity, so never blocks on NuxeoBlockingQueue.put(java.lang.Runnable)
and NuxeoBlockingQueue.offer(java.lang.Runnable)
always returns true
.
Modifier and Type | Field and Description |
---|---|
protected Lock |
lock |
protected Condition |
notEmpty |
protected RedisWorkQueuing |
queuing |
activation, activationLock, active, queueId
Constructor and Description |
---|
RedisBlockingQueue(String queueId,
RedisWorkQueuing queuing) |
Modifier and Type | Method and Description |
---|---|
protected static boolean |
delayExpired(AtomicLong atomic) |
int |
getQueueSize()
Gets the size of the queue.
|
protected WorkQueueMetrics |
metrics() |
Runnable |
poll(long timeout,
TimeUnit unit) |
Runnable |
pollElement()
Retrieves and removes an element from the queue, or returns null if the queue is empty.
|
void |
putElement(Runnable r)
Adds an element into this queue, waiting if necessary for space to become available.
|
Runnable |
take() |
awaitActivation, contains, drainTo, drainTo, iterator, offer, offer, peek, poll, put, remainingCapacity, setActive, size, timeUntil
containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
add, remove
addAll, clear, containsAll, equals, hashCode, isEmpty, parallelStream, removeAll, removeIf, retainAll, spliterator, stream, toArray, toArray
protected final RedisWorkQueuing queuing
public RedisBlockingQueue(String queueId, RedisWorkQueuing queuing)
protected WorkQueueMetrics metrics()
metrics
in class NuxeoBlockingQueue
public int getQueueSize()
NuxeoBlockingQueue
getQueueSize
in class NuxeoBlockingQueue
public Runnable take() throws InterruptedException
InterruptedException
public Runnable poll(long timeout, TimeUnit unit) throws InterruptedException
InterruptedException
public void putElement(Runnable r)
NuxeoBlockingQueue
putElement
in class NuxeoBlockingQueue
public Runnable pollElement()
NuxeoBlockingQueue
pollElement
in class NuxeoBlockingQueue
protected static boolean delayExpired(AtomicLong atomic)
Copyright © 2018 Nuxeo. All rights reserved.