Package org.redisson.api
Interface RBlockingQueue<V>
-
- Type Parameters:
V
- the type of elements held in this collection
- All Superinterfaces:
BlockingQueue<V>
,Collection<V>
,Iterable<V>
,Queue<V>
,RBlockingQueueAsync<V>
,RCollectionAsync<V>
,RExpirable
,RExpirableAsync
,RObject
,RObjectAsync
,RQueue<V>
,RQueueAsync<V>
- All Known Subinterfaces:
RBlockingDeque<V>
,RBoundedBlockingQueue<V>
,RPriorityBlockingDeque<V>
,RPriorityBlockingQueue<V>
- All Known Implementing Classes:
RedissonBlockingDeque
,RedissonBlockingQueue
,RedissonBoundedBlockingQueue
,RedissonPriorityBlockingDeque
,RedissonPriorityBlockingQueue
public interface RBlockingQueue<V> extends BlockingQueue<V>, RQueue<V>, RBlockingQueueAsync<V>
Distributed implementation ofBlockingQueue
- Author:
- Nikita Koksharov
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method 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 any queue and adds it at the head ofqueueName
, waiting up to the specified wait time if necessary for an element to become available in any of defined queues including queue itself.V
takeLastAndOfferFirstTo(String queueName)
Retrieves and removes last available tail element of any queue and adds it at the head ofqueueName
, waiting if necessary for an element to become available in any of defined queues including queue itself.-
Methods inherited from interface java.util.concurrent.BlockingQueue
add, contains, drainTo, drainTo, offer, offer, poll, put, remainingCapacity, remove, take
-
Methods inherited from interface java.util.Collection
addAll, clear, containsAll, equals, hashCode, isEmpty, iterator, parallelStream, removeAll, removeIf, retainAll, size, spliterator, stream, toArray, toArray, toArray
-
Methods inherited from interface org.redisson.api.RBlockingQueueAsync
drainToAsync, drainToAsync, pollAsync, pollFromAnyAsync, pollLastAndOfferFirstToAsync, putAsync, takeAsync, takeLastAndOfferFirstToAsync
-
Methods inherited from interface org.redisson.api.RCollectionAsync
addAllAsync, addAsync, containsAllAsync, containsAsync, removeAllAsync, removeAsync, retainAllAsync, sizeAsync
-
Methods inherited from interface org.redisson.api.RExpirable
clearExpire, expire, expireAt, expireAt, remainTimeToLive
-
Methods inherited from interface org.redisson.api.RExpirableAsync
clearExpireAsync, expireAsync, expireAtAsync, expireAtAsync, remainTimeToLiveAsync
-
Methods inherited from interface org.redisson.api.RObject
copy, delete, dump, getCodec, getName, isExists, migrate, move, rename, renamenx, restore, restore, restoreAndReplace, restoreAndReplace, touch, unlink
-
Methods inherited from interface org.redisson.api.RObjectAsync
copyAsync, deleteAsync, dumpAsync, isExistsAsync, migrateAsync, moveAsync, renameAsync, renamenxAsync, restoreAndReplaceAsync, restoreAndReplaceAsync, restoreAsync, restoreAsync, touchAsync, unlinkAsync
-
Methods inherited from interface org.redisson.api.RQueue
pollLastAndOfferFirstTo, readAll
-
Methods inherited from interface org.redisson.api.RQueueAsync
offerAsync, peekAsync, pollAsync, pollLastAndOfferFirstToAsync, readAllAsync
-
-
-
-
Method Detail
-
pollFromAny
V pollFromAny(long timeout, TimeUnit unit, String... queueNames) throws InterruptedException
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.- Parameters:
queueNames
- - queue names. Queue name itself is always includedtimeout
- how long to wait before giving up, in units ofunit
unit
- aTimeUnit
determining how to interpret thetimeout
parameter- Returns:
- the head of this queue, or
null
if the specified waiting time elapses before an element is available - Throws:
InterruptedException
- if interrupted while waiting
-
pollLastAndOfferFirstTo
V pollLastAndOfferFirstTo(String queueName, long timeout, TimeUnit unit) throws InterruptedException
Retrieves and removes last available tail element of any queue and adds it at the head ofqueueName
, waiting up to the specified wait time if necessary for an element to become available in any of defined queues including queue itself.- Parameters:
queueName
- - names of destination queuetimeout
- how long to wait before giving up, in units ofunit
unit
- aTimeUnit
determining how to interpret thetimeout
parameter- Returns:
- the tail of this queue, or
null
if the specified waiting time elapses before an element is available - Throws:
InterruptedException
- if interrupted while waiting
-
takeLastAndOfferFirstTo
V takeLastAndOfferFirstTo(String queueName) throws InterruptedException
Retrieves and removes last available tail element of any queue and adds it at the head ofqueueName
, waiting if necessary for an element to become available in any of defined queues including queue itself.- Parameters:
queueName
- - names of destination queue- Returns:
- the tail of this queue, or
null
if the specified waiting time elapses before an element is available - Throws:
InterruptedException
- if interrupted while waiting
-
-