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.intsubscribeOnFirstElements(Consumer<V> consumer) Deprecated.intsubscribeOnFirstElements(Function<V, CompletionStage<Void>> consumer) UsesubscribeOnLastElements(Function)instead.intsubscribeOnLastElements(Consumer<V> consumer) Deprecated.intsubscribeOnLastElements(Function<V, CompletionStage<Void>> 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, takeLastMethods inherited from interface java.util.concurrent.BlockingQueue
drainTo, drainTo, remainingCapacityMethods inherited from interface java.util.Collection
addAll, clear, containsAll, equals, hashCode, isEmpty, parallelStream, removeAll, removeIf, retainAll, spliterator, stream, toArray, toArrayMethods inherited from interface java.util.Deque
add, contains, descendingIterator, getFirst, getLast, offer, peekFirst, peekLast, pollFirst, pollLast, pop, remove, removeFirst, removeLastMethods inherited from interface org.redisson.api.RBlockingDequeAsync
moveAsync, pollFirstAsync, pollFirstFromAnyAsync, pollLastAsync, pollLastFromAnyAsync, putFirstAsync, putLastAsync, takeFirstAsync, takeLastAsyncMethods inherited from interface org.redisson.api.RBlockingQueue
pollFirstFromAny, pollFromAny, pollFromAnyWithName, pollLastAndOfferFirstTo, pollLastFromAny, subscribeOnElements, subscribeOnElements, takeLastAndOfferFirstTo, unsubscribeMethods inherited from interface org.redisson.api.RBlockingQueueAsync
drainToAsync, drainToAsync, pollAsync, pollFirstFromAnyAsync, pollFromAnyAsync, pollFromAnyWithNameAsync, pollLastAndOfferFirstToAsync, pollLastFromAnyAsync, putAsync, takeAsync, takeLastAndOfferFirstToAsyncMethods inherited from interface org.redisson.api.RCollectionAsync
addAllAsync, addAsync, containsAllAsync, containsAsync, removeAllAsync, removeAsync, retainAllAsync, sizeAsyncMethods inherited from interface org.redisson.api.RDeque
addFirst, addFirstIfExists, addLast, addLastIfExists, move, pollFirst, pollLastMethods 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, removeLastOccurrenceAsyncMethods inherited from interface org.redisson.api.RExpirable
clearExpire, expire, expire, expire, expireAt, expireAt, expireIfGreater, expireIfGreater, expireIfLess, expireIfLess, expireIfNotSet, expireIfNotSet, expireIfSet, expireIfSet, getExpireTime, remainTimeToLiveMethods inherited from interface org.redisson.api.RExpirableAsync
clearExpireAsync, expireAsync, expireAsync, expireAsync, expireAtAsync, expireAtAsync, expireIfGreaterAsync, expireIfGreaterAsync, expireIfLessAsync, expireIfLessAsync, expireIfNotSetAsync, expireIfNotSetAsync, expireIfSetAsync, expireIfSetAsync, getExpireTimeAsync, remainTimeToLiveAsyncMethods inherited from interface org.redisson.api.RObject
copy, copy, copy, copyAndReplace, copyAndReplace, delete, dump, getCodec, getIdleTime, getName, isExists, migrate, move, removeListener, rename, renamenx, restore, restore, restoreAndReplace, restoreAndReplace, sizeInMemory, touch, unlinkMethods inherited from interface org.redisson.api.RObjectAsync
copyAndReplaceAsync, copyAndReplaceAsync, copyAsync, copyAsync, copyAsync, deleteAsync, dumpAsync, getIdleTimeAsync, isExistsAsync, migrateAsync, moveAsync, removeListenerAsync, renameAsync, renamenxAsync, restoreAndReplaceAsync, restoreAndReplaceAsync, restoreAsync, restoreAsync, sizeInMemoryAsync, touchAsync, unlinkAsyncMethods inherited from interface org.redisson.api.RQueue
addListener, poll, pollLastAndOfferFirstTo, readAllMethods 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:
timeout- how long to wait before giving up, in units ofunitunit- aTimeUnitdetermining how to interpret thetimeoutparameterqueueNames- - names of queue- Returns:
- the head of this queue, or
nullif 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:
timeout- how long to wait before giving up, in units ofunitunit- aTimeUnitdetermining how to interpret thetimeoutparameterqueueNames- - names of queue- Returns:
- the head of this queue, or
nullif the specified waiting time elapses before an element is available - Throws:
InterruptedException- if interrupted while waiting
-
move
-
subscribeOnFirstElements
Deprecated.UsesubscribeOnFirstElements(Function)instead.- Parameters:
consumer- - queue elements listener- Returns:
- listenerId - id of listener
-
subscribeOnLastElements
Deprecated.UsesubscribeOnLastElements(Function)instead.- Parameters:
consumer- - queue elements listener- Returns:
- listenerId - id of listener
-
subscribeOnFirstElements
UsesubscribeOnLastElements(Function)instead. Continuously invokesRBlockingDequeAsync.takeFirstAsync()method to get a new element.NOTE: don't call blocking methods in the elements listener
- 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.NOTE: don't call blocking methods in the elements listener
- Parameters:
consumer- - queue elements listener- Returns:
- listenerId - id of listener
-