V
- the type of elements held in this collectionpublic interface RBlockingQueue<V> extends BlockingQueue<V>, RQueue<V>, RBlockingQueueAsync<V>
BlockingQueue
Modifier and Type | Method and Description |
---|---|
V |
pollFromAny(long timeout,
TimeUnit unit,
String... queueNames)
Retrieves and removes first available head element of any queue,
waiting up to the specified wait time if necessary for an element to become available
in any of defined queues including queue itself.
|
V |
pollLastAndOfferFirstTo(String queueName,
long timeout,
TimeUnit unit)
Retrieves and removes last available tail element of this queue and adds it at the head of
queueName ,
waiting up to the specified wait time if necessary for an element to become available. |
int |
subscribeOnElements(Consumer<V> consumer)
Subscribes on elements appeared in this queue.
|
V |
takeLastAndOfferFirstTo(String queueName)
Retrieves and removes last available tail element of any queue and adds it at the head of
queueName ,
waiting if necessary for an element to become available
in any of defined queues including queue itself. |
void |
unsubscribe(int listenerId)
Un-subscribes defined listener.
|
add, contains, drainTo, drainTo, offer, offer, poll, put, remainingCapacity, remove, take
addListener, poll, pollLastAndOfferFirstTo, readAll
addAll, clear, containsAll, equals, hashCode, isEmpty, iterator, parallelStream, removeAll, removeIf, retainAll, size, spliterator, stream, toArray, toArray
clearExpire, expire, expireAt, expireAt, remainTimeToLive
copy, delete, dump, getCodec, getName, isExists, migrate, move, removeListener, rename, renamenx, restore, restore, restoreAndReplace, restoreAndReplace, sizeInMemory, touch, unlink
drainToAsync, drainToAsync, pollAsync, pollFromAnyAsync, pollLastAndOfferFirstToAsync, putAsync, takeAsync, takeLastAndOfferFirstToAsync
addListenerAsync, offerAsync, peekAsync, pollAsync, pollAsync, pollLastAndOfferFirstToAsync, readAllAsync
addAllAsync, addAsync, containsAllAsync, containsAsync, removeAllAsync, removeAsync, retainAllAsync, sizeAsync
clearExpireAsync, expireAsync, expireAtAsync, expireAtAsync, remainTimeToLiveAsync
copyAsync, deleteAsync, dumpAsync, isExistsAsync, migrateAsync, moveAsync, removeListenerAsync, renameAsync, renamenxAsync, restoreAndReplaceAsync, restoreAndReplaceAsync, restoreAsync, restoreAsync, sizeInMemoryAsync, touchAsync, unlinkAsync
V pollFromAny(long timeout, TimeUnit unit, String... queueNames) throws InterruptedException
queueNames
- - queue names. Queue name itself is always includedtimeout
- how long to wait before giving up, in units of
unit
unit
- a TimeUnit
determining how to interpret the
timeout
parameternull
if the
specified waiting time elapses before an element is availableInterruptedException
- if interrupted while waitingV pollLastAndOfferFirstTo(String queueName, long timeout, TimeUnit unit) throws InterruptedException
queueName
,
waiting up to the specified wait time if necessary for an element to become available.queueName
- - names of destination queuetimeout
- how long to wait before giving up, in units of
unit
unit
- a TimeUnit
determining how to interpret the
timeout
parameternull
if the
specified waiting time elapses before an element is availableInterruptedException
- if interrupted while waitingV takeLastAndOfferFirstTo(String queueName) throws InterruptedException
queueName
,
waiting if necessary for an element to become available
in any of defined queues including queue itself.queueName
- - names of destination queuenull
if the
specified waiting time elapses before an element is availableInterruptedException
- if interrupted while waitingint subscribeOnElements(Consumer<V> consumer)
RBlockingQueueAsync.takeAsync()
method to get a new element.consumer
- - queue elements listenervoid unsubscribe(int listenerId)
listenerId
- - id of listenerCopyright © 2014–2020 Redisson. All rights reserved.