Package org.redisson.api
Interface RBlockingDeque<V>
- Type Parameters:
V
- the type of elements held in this collection
- All Superinterfaces:
BlockingDeque<V>
,BlockingQueue<V>
,Collection<V>
,Deque<V>
,Iterable<V>
,Queue<V>
,RBlockingDequeAsync<V>
,RBlockingQueue<V>
,RBlockingQueueAsync<V>
,RCollectionAsync<V>
,RDeque<V>
,RDequeAsync<V>
,RExpirable
,RExpirableAsync
,RObject
,RObjectAsync
,RQueue<V>
,RQueueAsync<V>
- All Known Subinterfaces:
RPriorityBlockingDeque<V>
- All Known Implementing Classes:
RedissonBlockingDeque
,RedissonPriorityBlockingDeque
public interface RBlockingDeque<V>
extends BlockingDeque<V>, RBlockingQueue<V>, RDeque<V>, RBlockingDequeAsync<V>
BlockingDeque
backed by Redis- Author:
- Nikita Koksharov
-
Method Summary
Modifier and TypeMethodDescriptionmove
(Duration timeout, DequeMoveArgs args) pollFirstFromAny
(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 own.pollLastFromAny
(long timeout, TimeUnit unit, String... queueNames) Retrieves and removes first available tail 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 own.int
subscribeOnFirstElements
(Consumer<V> consumer) Subscribes on first elements appeared in this queue.int
subscribeOnLastElements
(Consumer<V> consumer) Subscribes on last elements appeared in this queue.Methods inherited from interface java.util.concurrent.BlockingDeque
add, addFirst, addLast, contains, element, iterator, offer, offer, offerFirst, offerFirst, offerLast, offerLast, peek, poll, poll, pollFirst, pollLast, push, put, putFirst, putLast, remove, remove, removeFirstOccurrence, removeLastOccurrence, size, take, takeFirst, takeLast
Methods inherited from interface java.util.concurrent.BlockingQueue
drainTo, drainTo, remainingCapacity
Methods inherited from interface java.util.Collection
clear, containsAll, equals, hashCode, isEmpty, parallelStream, removeAll, removeIf, retainAll, spliterator, stream, toArray, toArray, toArray
Methods inherited from interface java.util.Deque
add, addAll, contains, descendingIterator, getFirst, getLast, offer, peekFirst, peekLast, pollFirst, pollLast, pop, remove, removeFirst, removeLast
Methods inherited from interface org.redisson.api.RBlockingDequeAsync
moveAsync, pollFirstAsync, pollFirstFromAnyAsync, pollLastAsync, pollLastFromAnyAsync, putFirstAsync, putLastAsync, takeFirstAsync, takeLastAsync
Methods inherited from interface org.redisson.api.RBlockingQueue
pollFirstFromAny, pollFromAny, pollFromAnyWithName, pollLastAndOfferFirstTo, pollLastFromAny, subscribeOnElements, takeLastAndOfferFirstTo, unsubscribe
Methods inherited from interface org.redisson.api.RBlockingQueueAsync
drainToAsync, drainToAsync, pollAsync, pollFirstFromAnyAsync, pollFromAnyAsync, pollFromAnyWithNameAsync, pollLastAndOfferFirstToAsync, pollLastFromAnyAsync, 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.RDeque
addFirst, addFirstIfExists, addLast, addLastIfExists, move, pollFirst, pollLast
Methods inherited from interface org.redisson.api.RDequeAsync
addFirstAsync, addFirstAsync, addFirstIfExistsAsync, addLastAsync, addLastAsync, addLastIfExistsAsync, getLastAsync, moveAsync, offerFirstAsync, offerLastAsync, peekFirstAsync, peekLastAsync, pollFirstAsync, pollFirstAsync, pollLastAsync, pollLastAsync, popAsync, pushAsync, removeFirstAsync, removeFirstOccurrenceAsync, removeLastAsync, removeLastOccurrenceAsync
Methods inherited from interface org.redisson.api.RExpirable
clearExpire, expire, expire, expire, expireAt, expireAt, expireIfGreater, expireIfGreater, expireIfLess, expireIfLess, expireIfNotSet, expireIfNotSet, expireIfSet, expireIfSet, getExpireTime, remainTimeToLive
Methods inherited from interface org.redisson.api.RExpirableAsync
clearExpireAsync, expireAsync, expireAsync, expireAsync, expireAtAsync, expireAtAsync, expireIfGreaterAsync, expireIfGreaterAsync, expireIfLessAsync, expireIfLessAsync, expireIfNotSetAsync, expireIfNotSetAsync, expireIfSetAsync, expireIfSetAsync, getExpireTimeAsync, remainTimeToLiveAsync
Methods inherited from interface org.redisson.api.RObject
copy, delete, dump, getCodec, getIdleTime, getName, isExists, migrate, move, removeListener, rename, renamenx, restore, restore, restoreAndReplace, restoreAndReplace, sizeInMemory, touch, unlink
Methods inherited from interface org.redisson.api.RObjectAsync
copyAsync, deleteAsync, dumpAsync, getIdleTimeAsync, isExistsAsync, migrateAsync, moveAsync, removeListenerAsync, renameAsync, renamenxAsync, restoreAndReplaceAsync, restoreAndReplaceAsync, restoreAsync, restoreAsync, sizeInMemoryAsync, touchAsync, unlinkAsync
Methods inherited from interface org.redisson.api.RQueue
addListener, poll, pollLastAndOfferFirstTo, readAll
Methods inherited from interface org.redisson.api.RQueueAsync
addListenerAsync, offerAsync, peekAsync, pollAsync, pollAsync, pollLastAndOfferFirstToAsync, readAllAsync
-
Method Details
-
pollFirstFromAny
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 own.- Parameters:
queueNames
- - names of queuetimeout
- 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
-
pollLastFromAny
Retrieves and removes first available tail 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 own.- Parameters:
queueNames
- - names of queuetimeout
- 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
-
move
-
subscribeOnFirstElements
Subscribes on first elements appeared in this queue. Continuously invokesRBlockingDequeAsync.takeFirstAsync()
method to get a new element.- Parameters:
consumer
- - queue elements listener- Returns:
- listenerId - id of listener
-
subscribeOnLastElements
Subscribes on last elements appeared in this queue. Continuously invokesRBlockingDequeAsync.takeLastAsync()
method to get a new element.- Parameters:
consumer
- - queue elements listener- Returns:
- listenerId - id of listener
-