Class RedissonBlockingDeque<V>
- All Implemented Interfaces:
Iterable<V>,Collection<V>,BlockingDeque<V>,BlockingQueue<V>,Deque<V>,List<V>,Queue<V>,RandomAccess,SequencedCollection<V>,RBlockingDeque<V>,RBlockingDequeAsync<V>,RBlockingQueue<V>,RBlockingQueueAsync<V>,RCollectionAsync<V>,RDeque<V>,RDequeAsync<V>,RExpirable,RExpirableAsync,RList<V>,RListAsync<V>,RObject,RObjectAsync,RQueue<V>,RQueueAsync<V>,RSortable<List<V>>,RSortableAsync<List<V>>
Distributed and concurrent implementation of BlockingDeque.
Queue size limited by Redis server memory amount. This is why remainingCapacity() always
returns Integer.MAX_VALUE
- Author:
- Nikita Koksharov
-
Field Summary
Fields inherited from class org.redisson.RedissonObject
codec, commandExecutor, name -
Constructor Summary
ConstructorsConstructorDescriptionRedissonBlockingDeque(Codec codec, CommandAsyncExecutor commandExecutor, String name, RedissonClient redisson) RedissonBlockingDeque(CommandAsyncExecutor commandExecutor, String name, RedissonClient redisson) -
Method Summary
Modifier and TypeMethodDescriptionbooleanClear an expire timeout or expire date for object.Clear an expire timeout or expire date for object in async mode.clearExpireAsync(String... keys) intdrainTo(Collection<? super V> c) intdrainTo(Collection<? super V> c, int maxElements) drainToAsync(Collection<? super V> c) Removes all available elements from this queue and adds them to the given collection in async mode.drainToAsync(Collection<? super V> c, int maxElements) Removes at most the given number of available elements from this queue and adds them to the given collection in async mode.booleanUseRExpirable.expire(Duration)insteadbooleanSets a timeout for this object.booleanSets an expiration date for this object.expireAsync(long timeToLive, TimeUnit timeUnit) UseRExpirableAsync.expireAsync(Duration)insteadexpireAsync(long timeToLive, TimeUnit timeUnit, String param, String... keys) expireAsync(Duration duration) Set a timeout for object.expireAsync(Instant instant) Set an expire date for object.booleanexpireAt(long timestamp) UseRExpirable.expire(Instant)insteadbooleanUseRExpirable.expire(Instant)insteadexpireAtAsync(long timestamp) UseRExpirableAsync.expireAsync(Instant)insteadexpireAtAsync(long timestamp, String param, String... keys) expireAtAsync(Date timestamp) UseRExpirableAsync.expireAsync(Instant)insteadbooleanexpireIfGreater(Duration duration) Sets a timeout for this object only if it's greater than timeout set before.booleanexpireIfGreater(Instant time) Sets an expiration date for this object only if it's greater than expiration date set before.expireIfGreaterAsync(Duration duration) Sets a timeout for this object only if it's greater than timeout set before.expireIfGreaterAsync(Instant time) Sets an expiration date for this object only if it's greater than expiration date set before.booleanexpireIfLess(Duration duration) Sets a timeout for this object only if it's less than timeout set before.booleanexpireIfLess(Instant time) Sets an expiration date for this object only if it's less than expiration date set before.expireIfLessAsync(Duration duration) Sets a timeout for this object only if it's less than timeout set before.expireIfLessAsync(Instant time) Sets an expiration date for this object only if it's less than expiration date set before.booleanexpireIfNotSet(Duration duration) Sets a timeout for this object only if it hasn't been set before.booleanexpireIfNotSet(Instant time) Sets an expiration date for this object only if it hasn't been set before.expireIfNotSetAsync(Duration duration) Sets a timeout for this object only if it hasn't been set before.expireIfNotSetAsync(Instant time) Sets an expiration date for this object only if it hasn't been set before.booleanexpireIfSet(Duration duration) Sets a timeout for this object only if it has been already set.booleanexpireIfSet(Instant time) Sets an expiration date for this object only if it has been already set.expireIfSetAsync(Duration duration) Sets a timeout for this object only if it has been already set.expireIfSetAsync(Instant time) Sets an expiration date for this object only if it has been already set.longExpiration time of Redisson object that has a timeoutExpiration time of Redisson object that has a timeoutmove(Duration timeout, DequeMoveArgs args) moveAsync(Duration timeout, DequeMoveArgs args) booleanbooleanofferFirst(V e, long timeout, TimeUnit unit) booleanRetrieves and removes the head of this queue in async mode, waiting up to the specified wait time if necessary for an element to become available.pollFirstAsync(long timeout, TimeUnit unit) Retrieves and removes value at the head of queue.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.pollFirstFromAny(Duration duration, int count, String... queueNames) Retrieves and removes first available head elements 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.pollFirstFromAnyAsync(long timeout, TimeUnit unit, String... queueNames) Retrieves and removes first available head element of any queue in async mode, waiting up to the specified wait time if necessary for an element to become available in any of defined queues including queue own.pollFirstFromAnyAsync(Duration duration, int count, String... queueNames) Retrieves and removes first available head elements 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.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.pollFromAnyAsync(long timeout, TimeUnit unit, String... queueNames) Retrieves and removes first available head element of any queue in async mode, waiting up to the specified wait time if necessary for an element to become available in any of defined queues including queue itself.pollFromAnyWithName(Duration timeout, 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.pollFromAnyWithNameAsync(Duration timeout, String... queueNames) Retrieves and removes first available head element of any queue in async mode, waiting up to the specified wait time if necessary for an element to become available in any of defined queues including queue itself.pollLastAndOfferFirstTo(String queueName, long timeout, TimeUnit unit) Retrieves and removes last available tail element of this queue and adds it at the head ofqueueName, waiting up to the specified wait time if necessary for an element to become available.pollLastAndOfferFirstToAsync(String queueName, long timeout, TimeUnit unit) Retrieves and removes last available tail element of this queue and adds it at the head ofqueueName, waiting up to the specified wait time if necessary for an element to become available.pollLastAsync(long timeout, TimeUnit unit) Retrieves and removes value at the tail of queue.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.pollLastFromAny(Duration duration, int count, String... queueNames) Retrieves and removes first available tail elements 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.pollLastFromAnyAsync(long timeout, TimeUnit unit, String... queueNames) Retrieves and removes first available tail element of any queue in async mode, waiting up to the specified wait time if necessary for an element to become available in any of defined queues including queue own.pollLastFromAnyAsync(Duration duration, int count, String... queueNames) Retrieves and removes first available tail elements 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.voidInserts the specified element into this queue in async mode, waiting if necessary for space to become available.voidputFirstAsync(V e) Adds value to the head of queue.voidputLastAsync(V e) Adds value to the tail of queue.intlongRemaining time to live of Redisson object that has a timeoutRemaining time to live of Redisson object that has a timeoutintsubscribeOnElements(Consumer<V> consumer) Subscribes on elements appeared in this queue.intsubscribeOnFirstElements(Consumer<V> consumer) Subscribes on first elements appeared in this queue.intsubscribeOnLastElements(Consumer<V> consumer) Subscribes on last elements appeared in this queue.take()Retrieves and removes the head of this queue in async mode, waiting if necessary until an element becomes available.Retrieves and removes value at the head of queue.takeLast()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.takeLastAndOfferFirstToAsync(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.Retrieves and removes value at the tail of queue.voidunsubscribe(int id) Un-subscribes defined listener.Methods inherited from class org.redisson.RedissonDeque
addFirst, addFirst, addFirstAsync, addFirstAsync, addFirstIfExists, addFirstIfExistsAsync, addLast, addLast, addLastAsync, addLastAsync, addLastIfExists, addLastIfExistsAsync, descendingIterator, getLast, getLastAsync, move, moveAsync, offerFirst, offerFirstAsync, offerLast, offerLastAsync, peekFirst, peekFirstAsync, peekLast, peekLastAsync, pollFirst, pollFirst, pollFirstAsync, pollFirstAsync, pollLast, pollLast, pollLastAsync, pollLastAsync, pop, popAsync, push, pushAsync, removeFirstAsync, removeFirstOccurrence, removeFirstOccurrenceAsync, removeLast, removeLastAsync, removeLastOccurrence, removeLastOccurrenceAsync, reversedMethods inherited from class org.redisson.RedissonQueue
element, getFirst, offer, offerAsync, peek, peekAsync, poll, poll, pollAsync, pollAsync, pollLastAndOfferFirstTo, pollLastAndOfferFirstToAsync, remove, removeFirstMethods inherited from class org.redisson.RedissonList
add, add, addAfter, addAfterAsync, addAll, addAll, addAllAsync, addAllAsync, addAsync, addAsync, addAsync, addBefore, addBeforeAsync, addListener, addListenerAsync, clear, contains, containsAll, containsAllAsync, containsAsync, distributedIterator, distributedIterator, equals, fastRemove, fastRemoveAsync, fastSet, fastSetAsync, get, get, getAsync, getAsync, hashCode, indexOf, indexOfAsync, indexOfAsync, isEmpty, iterator, lastIndexOf, lastIndexOfAsync, lastIndexOfAsync, listIterator, listIterator, mapReduce, range, range, rangeAsync, rangeAsync, readAll, readAllAsync, readSort, readSort, readSort, readSort, readSort, readSort, readSortAlpha, readSortAlpha, readSortAlpha, readSortAlpha, readSortAlpha, readSortAlpha, readSortAlphaAsync, readSortAlphaAsync, readSortAlphaAsync, readSortAlphaAsync, readSortAlphaAsync, readSortAlphaAsync, readSortAsync, readSortAsync, readSortAsync, readSortAsync, readSortAsync, readSortAsync, remove, remove, remove, removeAll, removeAllAsync, removeAsync, removeAsync, removeAsync, removeIf, removeListener, removeListenerAsync, retainAll, retainAllAsync, set, setAsync, size, sizeAsync, sortTo, sortTo, sortTo, sortTo, sortTo, sortTo, sortToAsync, sortToAsync, sortToAsync, sortToAsync, sortToAsync, sortToAsync, subList, toArray, toArray, toString, trim, trimAsyncMethods inherited from class org.redisson.RedissonObject
addListener, addListenerAsync, copy, copyAsync, delete, deleteAsync, deleteAsync, dump, dumpAsync, encode, encode, encode, encode, encodeMapKey, encodeMapKey, encodeMapKeys, encodeMapValue, encodeMapValues, get, getCodec, getIdleTime, getIdleTimeAsync, getLockByMapKey, getLockByValue, getName, getRawName, getRawName, getServiceManager, getSubscribeService, isExists, isExistsAsync, map, migrate, migrateAsync, move, moveAsync, prefixName, rename, renameAsync, renamenx, renamenxAsync, restore, restore, restoreAndReplace, restoreAndReplace, restoreAndReplaceAsync, restoreAndReplaceAsync, restoreAsync, restoreAsync, setName, sizeInMemory, sizeInMemoryAsync, sizeInMemoryAsync, sizeInMemoryAsync, suffixName, toSeconds, toStream, touch, touchAsync, unlink, unlinkAsyncMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.concurrent.BlockingDeque
add, addFirst, addLast, contains, element, iterator, offer, offerFirst, offerLast, peek, poll, push, remove, remove, removeFirstOccurrence, removeLastOccurrence, sizeMethods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArrayMethods inherited from interface java.util.Deque
add, addAll, contains, descendingIterator, getFirst, getLast, offer, peekFirst, peekLast, pollFirst, pollLast, pop, remove, removeFirst, removeLast, reversedMethods inherited from interface java.util.List
replaceAll, sort, spliteratorMethods 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, 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
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
-
Constructor Details
-
RedissonBlockingDeque
public RedissonBlockingDeque(CommandAsyncExecutor commandExecutor, String name, RedissonClient redisson) -
RedissonBlockingDeque
public RedissonBlockingDeque(Codec codec, CommandAsyncExecutor commandExecutor, String name, RedissonClient redisson)
-
-
Method Details
-
putAsync
Description copied from interface:RBlockingQueueAsyncInserts the specified element into this queue in async mode, waiting if necessary for space to become available.- Specified by:
putAsyncin interfaceRBlockingQueueAsync<V>- Parameters:
e- the element to add- Returns:
- void
-
put
- Specified by:
putin interfaceBlockingDeque<V>- Specified by:
putin interfaceBlockingQueue<V>- Throws:
InterruptedException
-
offer
- Specified by:
offerin interfaceBlockingDeque<V>- Specified by:
offerin interfaceBlockingQueue<V>- Throws:
InterruptedException
-
takeAsync
Description copied from interface:RBlockingQueueAsyncRetrieves and removes the head of this queue in async mode, waiting if necessary until an element becomes available.- Specified by:
takeAsyncin interfaceRBlockingQueueAsync<V>- Returns:
- the head of this queue
-
take
- Specified by:
takein interfaceBlockingDeque<V>- Specified by:
takein interfaceBlockingQueue<V>- Throws:
InterruptedException
-
pollAsync
Description copied from interface:RBlockingQueueAsyncRetrieves and removes the head of this queue in async mode, waiting up to the specified wait time if necessary for an element to become available.- Specified by:
pollAsyncin interfaceRBlockingQueueAsync<V>- Parameters:
timeout- how long to wait before giving up, in units ofunitunit- aTimeUnitdetermining how to interpret thetimeoutparameter- Returns:
- the head of this queue, or
nullif the specified waiting time elapses before an element is available
-
poll
- Specified by:
pollin interfaceBlockingDeque<V>- Specified by:
pollin interfaceBlockingQueue<V>- Throws:
InterruptedException
-
pollFromAny
Description copied from interface:RBlockingQueueRetrieves 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.- Specified by:
pollFromAnyin interfaceRBlockingQueue<V>- Parameters:
timeout- how long to wait before giving up, in units ofunitunit- aTimeUnitdetermining how to interpret thetimeoutparameterqueueNames- - queue names. Queue name itself is always included- Returns:
- the head of this queue, or
nullif the specified waiting time elapses before an element is available - Throws:
InterruptedException- if interrupted while waiting
-
pollFromAnyAsync
Description copied from interface:RBlockingQueueAsyncRetrieves and removes first available head element of any queue in async mode, waiting up to the specified wait time if necessary for an element to become available in any of defined queues including queue itself.- Specified by:
pollFromAnyAsyncin interfaceRBlockingQueueAsync<V>- Parameters:
timeout- how long to wait before giving up, in units ofunitunit- aTimeUnitdetermining how to interpret thetimeoutparameterqueueNames- - queue names. Queue name itself is always included- Returns:
- Future object with the head of this queue, or
nullif the specified waiting time elapses before an element is available
-
pollFromAnyWithName
public Entry<String,V> pollFromAnyWithName(Duration timeout, String... queueNames) throws InterruptedException Description copied from interface:RBlockingQueueRetrieves 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.- Specified by:
pollFromAnyWithNamein interfaceRBlockingQueue<V>- Parameters:
timeout- how long to wait before giving up, in units ofunitqueueNames- queue names. Queue name itself is always included- Returns:
- the head of this queue, or
nullif the specified waiting time elapses before an element is available - Throws:
InterruptedException- if interrupted while waiting
-
pollFromAnyWithNameAsync
Description copied from interface:RBlockingQueueAsyncRetrieves and removes first available head element of any queue in async mode, waiting up to the specified wait time if necessary for an element to become available in any of defined queues including queue itself.- Specified by:
pollFromAnyWithNameAsyncin interfaceRBlockingQueueAsync<V>- Parameters:
timeout- how long to wait before giving upqueueNames- - queue names. Queue name itself is always included- Returns:
- Future object with the head of this queue, or
nullif the specified waiting time elapses before an element is available
-
pollLastAndOfferFirstToAsync
Description copied from interface:RBlockingQueueAsyncRetrieves and removes last available tail element of this queue and adds it at the head ofqueueName, waiting up to the specified wait time if necessary for an element to become available.- Specified by:
pollLastAndOfferFirstToAsyncin interfaceRBlockingQueueAsync<V>- Parameters:
queueName- - names of destination queuetimeout- how long to wait before giving up, in units ofunitunit- aTimeUnitdetermining how to interpret thetimeoutparameter- Returns:
- the tail of this queue, or
nullif the specified waiting time elapses before an element is available
-
pollLastAndOfferFirstTo
public V pollLastAndOfferFirstTo(String queueName, long timeout, TimeUnit unit) throws InterruptedException Description copied from interface:RBlockingQueueRetrieves and removes last available tail element of this queue and adds it at the head ofqueueName, waiting up to the specified wait time if necessary for an element to become available.- Specified by:
pollLastAndOfferFirstToin interfaceRBlockingQueue<V>- Parameters:
queueName- - names of destination queuetimeout- how long to wait before giving up, in units ofunitunit- aTimeUnitdetermining how to interpret thetimeoutparameter- Returns:
- the tail of this queue, or
nullif the specified waiting time elapses before an element is available - Throws:
InterruptedException- if interrupted while waiting
-
pollFirstFromAny
public Map<String,List<V>> pollFirstFromAny(Duration duration, int count, String... queueNames) throws InterruptedException Description copied from interface:RBlockingQueueRetrieves and removes first available head elements 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.Requires Redis 7.0.0 and higher.
- Specified by:
pollFirstFromAnyin interfaceRBlockingQueue<V>- Parameters:
duration- how long to wait before giving upcount- elements amountqueueNames- name of queues- Returns:
- the head elements
- Throws:
InterruptedException
-
pollLastFromAny
public Map<String,List<V>> pollLastFromAny(Duration duration, int count, String... queueNames) throws InterruptedException Description copied from interface:RBlockingQueueRetrieves and removes first available tail elements 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.Requires Redis 7.0.0 and higher.
- Specified by:
pollLastFromAnyin interfaceRBlockingQueue<V>- Parameters:
duration- how long to wait before giving upcount- elements amountqueueNames- name of queues- Returns:
- the tail elements
- Throws:
InterruptedException
-
pollFirstFromAnyAsync
public RFuture<Map<String,List<V>>> pollFirstFromAnyAsync(Duration duration, int count, String... queueNames) Description copied from interface:RBlockingQueueAsyncRetrieves and removes first available head elements 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.Requires Redis 7.0.0 and higher.
- Specified by:
pollFirstFromAnyAsyncin interfaceRBlockingQueueAsync<V>- Parameters:
duration- how long to wait before giving upcount- elements amountqueueNames- name of queues- Returns:
- the head elements
-
pollLastFromAnyAsync
public RFuture<Map<String,List<V>>> pollLastFromAnyAsync(Duration duration, int count, String... queueNames) Description copied from interface:RBlockingQueueAsyncRetrieves and removes first available tail elements 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.Requires Redis 7.0.0 and higher.
- Specified by:
pollLastFromAnyAsyncin interfaceRBlockingQueueAsync<V>- Parameters:
duration- how long to wait before giving upcount- elements amountqueueNames- name of queues- Returns:
- the tail elements
-
takeLastAndOfferFirstTo
Description copied from interface:RBlockingQueueRetrieves 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.- Specified by:
takeLastAndOfferFirstToin interfaceRBlockingQueue<V>- Parameters:
queueName- - names of destination queue- Returns:
- the tail of this queue, or
nullif the specified waiting time elapses before an element is available - Throws:
InterruptedException- if interrupted while waiting
-
subscribeOnElements
Description copied from interface:RBlockingQueueSubscribes on elements appeared in this queue. Continuously invokesRBlockingQueueAsync.takeAsync()method to get a new element.- Specified by:
subscribeOnElementsin interfaceRBlockingQueue<V>- Parameters:
consumer- - queue elements listener- Returns:
- listenerId - id of listener
-
unsubscribe
public void unsubscribe(int id) Description copied from interface:RBlockingQueueUn-subscribes defined listener.- Specified by:
unsubscribein interfaceRBlockingQueue<V>- Parameters:
id- - id of listener
-
takeLastAndOfferFirstToAsync
Description copied from interface:RBlockingQueueAsyncRetrieves 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.- Specified by:
takeLastAndOfferFirstToAsyncin interfaceRBlockingQueueAsync<V>- Parameters:
queueName- - names of destination queue- Returns:
- the tail of this queue, or
nullif the specified waiting time elapses before an element is available
-
remainingCapacity
public int remainingCapacity()- Specified by:
remainingCapacityin interfaceBlockingQueue<V>
-
drainTo
- Specified by:
drainToin interfaceBlockingQueue<V>
-
drainToAsync
Description copied from interface:RBlockingQueueAsyncRemoves all available elements from this queue and adds them to the given collection in async mode. This operation may be more efficient than repeatedly polling this queue. A failure encountered while attempting to add elements to collectioncmay result in elements being in neither, either or both collections when the associated exception is thrown. Attempts to drain a queue to itself result inIllegalArgumentException. Further, the behavior of this operation is undefined if the specified collection is modified while the operation is in progress.- Specified by:
drainToAsyncin interfaceRBlockingQueueAsync<V>- Parameters:
c- the collection to transfer elements into- Returns:
- the number of elements transferred
-
drainTo
- Specified by:
drainToin interfaceBlockingQueue<V>
-
drainToAsync
Description copied from interface:RBlockingQueueAsyncRemoves at most the given number of available elements from this queue and adds them to the given collection in async mode. A failure encountered while attempting to add elements to collectioncmay result in elements being in neither, either or both collections when the associated exception is thrown. Attempts to drain a queue to itself result inIllegalArgumentException. Further, the behavior of this operation is undefined if the specified collection is modified while the operation is in progress.- Specified by:
drainToAsyncin interfaceRBlockingQueueAsync<V>- Parameters:
c- the collection to transfer elements intomaxElements- the maximum number of elements to transfer- Returns:
- the number of elements transferred
-
putFirstAsync
Description copied from interface:RBlockingDequeAsyncAdds value to the head of queue.- Specified by:
putFirstAsyncin interfaceRBlockingDequeAsync<V>- Parameters:
e- value- Returns:
- void
-
putLastAsync
Description copied from interface:RBlockingDequeAsyncAdds value to the tail of queue.- Specified by:
putLastAsyncin interfaceRBlockingDequeAsync<V>- Parameters:
e- value- Returns:
- void
-
putFirst
- Specified by:
putFirstin interfaceBlockingDeque<V>- Throws:
InterruptedException
-
putLast
- Specified by:
putLastin interfaceBlockingDeque<V>- Throws:
InterruptedException
-
offerFirst
- Specified by:
offerFirstin interfaceBlockingDeque<V>- Throws:
InterruptedException
-
offerLast
- Specified by:
offerLastin interfaceBlockingDeque<V>- Throws:
InterruptedException
-
takeFirst
- Specified by:
takeFirstin interfaceBlockingDeque<V>- Throws:
InterruptedException
-
takeFirstAsync
Description copied from interface:RBlockingDequeAsyncRetrieves and removes value at the head of queue. Waits for an element become available.- Specified by:
takeFirstAsyncin interfaceRBlockingDequeAsync<V>- Returns:
- the head element of this queue
-
takeLastAsync
Description copied from interface:RBlockingDequeAsyncRetrieves and removes value at the tail of queue. Waits for an element become available.- Specified by:
takeLastAsyncin interfaceRBlockingDequeAsync<V>- Returns:
- the tail element of this queue
-
takeLast
- Specified by:
takeLastin interfaceBlockingDeque<V>- Throws:
InterruptedException
-
pollFirstAsync
Description copied from interface:RBlockingDequeAsyncRetrieves and removes value at the head of queue. If necessary waits up to definedtimeoutfor an element become available.- Specified by:
pollFirstAsyncin interfaceRBlockingDequeAsync<V>- Parameters:
timeout- how long to wait before giving up, in units ofunitunit- aTimeUnitdetermining how to interpret thetimeoutparameter- Returns:
- the element at the tail of this queue, or
nullif the specified waiting time elapses before an element is available
-
pollFirstFromAny
public V pollFirstFromAny(long timeout, TimeUnit unit, String... queueNames) throws InterruptedException Description copied from interface:RBlockingDequeRetrieves 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.- Specified by:
pollFirstFromAnyin interfaceRBlockingDeque<V>- 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
-
pollFirstFromAnyAsync
Description copied from interface:RBlockingDequeAsyncRetrieves and removes first available head element of any queue in async mode, waiting up to the specified wait time if necessary for an element to become available in any of defined queues including queue own.- Specified by:
pollFirstFromAnyAsyncin interfaceRBlockingDequeAsync<V>- 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
-
pollLastFromAny
public V pollLastFromAny(long timeout, TimeUnit unit, String... queueNames) throws InterruptedException Description copied from interface:RBlockingDequeRetrieves 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.- Specified by:
pollLastFromAnyin interfaceRBlockingDeque<V>- 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
-
subscribeOnFirstElements
Description copied from interface:RBlockingDequeSubscribes on first elements appeared in this queue. Continuously invokesRBlockingDequeAsync.takeFirstAsync()method to get a new element.- Specified by:
subscribeOnFirstElementsin interfaceRBlockingDeque<V>- Parameters:
consumer- - queue elements listener- Returns:
- listenerId - id of listener
-
subscribeOnLastElements
Description copied from interface:RBlockingDequeSubscribes on last elements appeared in this queue. Continuously invokesRBlockingDequeAsync.takeLastAsync()method to get a new element.- Specified by:
subscribeOnLastElementsin interfaceRBlockingDeque<V>- Parameters:
consumer- - queue elements listener- Returns:
- listenerId - id of listener
-
pollLastFromAnyAsync
Description copied from interface:RBlockingDequeAsyncRetrieves and removes first available tail element of any queue in async mode, waiting up to the specified wait time if necessary for an element to become available in any of defined queues including queue own.- Specified by:
pollLastFromAnyAsyncin interfaceRBlockingDequeAsync<V>- 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
-
pollFirst
- Specified by:
pollFirstin interfaceBlockingDeque<V>- Throws:
InterruptedException
-
pollLastAsync
Description copied from interface:RBlockingDequeAsyncRetrieves and removes value at the tail of queue. If necessary waits up to definedtimeoutfor an element become available.- Specified by:
pollLastAsyncin interfaceRBlockingDequeAsync<V>- Parameters:
timeout- how long to wait before giving up, in units ofunitunit- aTimeUnitdetermining how to interpret thetimeoutparameter- Returns:
- the element at the head of this queue, or
nullif the specified waiting time elapses before an element is available
-
pollLast
- Specified by:
pollLastin interfaceBlockingDeque<V>- Throws:
InterruptedException
-
move
- Specified by:
movein interfaceRBlockingDeque<V>
-
moveAsync
- Specified by:
moveAsyncin interfaceRBlockingDequeAsync<V>
-
expire
Description copied from interface:RExpirableUseRExpirable.expire(Duration)instead- Specified by:
expirein interfaceRExpirable- Parameters:
timeToLive- - timeout before object will be deletedtimeUnit- - timeout time unit- Returns:
trueif the timeout was set andfalseif not
-
expireAsync
Description copied from interface:RExpirableAsyncUseRExpirableAsync.expireAsync(Duration)instead- Specified by:
expireAsyncin interfaceRExpirableAsync- Parameters:
timeToLive- - timeout before object will be deletedtimeUnit- - timeout time unit- Returns:
trueif the timeout was set andfalseif not
-
expireAt
public boolean expireAt(long timestamp) Description copied from interface:RExpirableUseRExpirable.expire(Instant)instead- Specified by:
expireAtin interfaceRExpirable- Parameters:
timestamp- - expire date in milliseconds (Unix timestamp)- Returns:
trueif the timeout was set andfalseif not
-
expireAtAsync
Description copied from interface:RExpirableAsyncUseRExpirableAsync.expireAsync(Instant)instead- Specified by:
expireAtAsyncin interfaceRExpirableAsync- Parameters:
timestamp- - expire date in milliseconds (Unix timestamp)- Returns:
trueif the timeout was set andfalseif not
-
expire
Description copied from interface:RExpirableSets an expiration date for this object. When expire date comes the key will automatically be deleted.- Specified by:
expirein interfaceRExpirable- Parameters:
instant- expire date- Returns:
trueif the timeout was set andfalseif not
-
expireIfSet
Description copied from interface:RExpirableSets an expiration date for this object only if it has been already set. When expire date comes the object will automatically be deleted.Requires Redis 7.0.0 and higher.
- Specified by:
expireIfSetin interfaceRExpirable- Parameters:
time- expire date- Returns:
trueif the timeout was set andfalseif not
-
expireIfSetAsync
Description copied from interface:RExpirableAsyncSets an expiration date for this object only if it has been already set. When expire date comes the object will automatically be deleted.Requires Redis 7.0.0 and higher.
- Specified by:
expireIfSetAsyncin interfaceRExpirableAsync- Parameters:
time- expire date- Returns:
trueif the timeout was set andfalseif not
-
expireIfNotSet
Description copied from interface:RExpirableSets an expiration date for this object only if it hasn't been set before. When expire date comes the object will automatically be deleted.Requires Redis 7.0.0 and higher.
- Specified by:
expireIfNotSetin interfaceRExpirable- Parameters:
time- expire date- Returns:
trueif the timeout was set andfalseif not
-
expireIfNotSetAsync
Description copied from interface:RExpirableAsyncSets an expiration date for this object only if it hasn't been set before. When expire date comes the object will automatically be deleted.Requires Redis 7.0.0 and higher.
- Specified by:
expireIfNotSetAsyncin interfaceRExpirableAsync- Parameters:
time- expire date- Returns:
trueif the timeout was set andfalseif not
-
expireIfGreater
Description copied from interface:RExpirableSets an expiration date for this object only if it's greater than expiration date set before. When expire date comes the object will automatically be deleted.Requires Redis 7.0.0 and higher.
- Specified by:
expireIfGreaterin interfaceRExpirable- Parameters:
time- expire date- Returns:
trueif the timeout was set andfalseif not
-
expireIfGreaterAsync
Description copied from interface:RExpirableAsyncSets an expiration date for this object only if it's greater than expiration date set before. When expire date comes the object will automatically be deleted.Requires Redis 7.0.0 and higher.
- Specified by:
expireIfGreaterAsyncin interfaceRExpirableAsync- Parameters:
time- expire date- Returns:
trueif the timeout was set andfalseif not
-
expireIfLess
Description copied from interface:RExpirableSets an expiration date for this object only if it's less than expiration date set before. When expire date comes the object will automatically be deleted.Requires Redis 7.0.0 and higher.
- Specified by:
expireIfLessin interfaceRExpirable- Parameters:
time- expire date- Returns:
trueif the timeout was set andfalseif not
-
expireIfLessAsync
Description copied from interface:RExpirableAsyncSets an expiration date for this object only if it's less than expiration date set before. When expire date comes the object will automatically be deleted.Requires Redis 7.0.0 and higher.
- Specified by:
expireIfLessAsyncin interfaceRExpirableAsync- Parameters:
time- expire date- Returns:
trueif the timeout was set andfalseif not
-
expireAsync
Description copied from interface:RExpirableAsyncSet an expire date for object. When expire date comes the key will automatically be deleted.- Specified by:
expireAsyncin interfaceRExpirableAsync- Parameters:
instant- - expire date- Returns:
trueif the timeout was set andfalseif not
-
expire
Description copied from interface:RExpirableSets a timeout for this object. After the timeout has expired, the key will automatically be deleted.- Specified by:
expirein interfaceRExpirable- Parameters:
duration- timeout before object will be deleted- Returns:
trueif the timeout was set andfalseif not
-
expireAsync
Description copied from interface:RExpirableAsyncSet a timeout for object. After the timeout has expired, the key will automatically be deleted.- Specified by:
expireAsyncin interfaceRExpirableAsync- Parameters:
duration- timeout before object will be deleted- Returns:
trueif the timeout was set andfalseif not
-
expireAt
Description copied from interface:RExpirableUseRExpirable.expire(Instant)instead- Specified by:
expireAtin interfaceRExpirable- Parameters:
timestamp- - expire date- Returns:
trueif the timeout was set andfalseif not
-
expireAtAsync
Description copied from interface:RExpirableAsyncUseRExpirableAsync.expireAsync(Instant)instead- Specified by:
expireAtAsyncin interfaceRExpirableAsync- Parameters:
timestamp- - expire date- Returns:
trueif the timeout was set andfalseif not
-
expireIfSet
Description copied from interface:RExpirableSets a timeout for this object only if it has been already set. After the timeout has expired, the key will automatically be deleted.Requires Redis 7.0.0 and higher.
- Specified by:
expireIfSetin interfaceRExpirable- Parameters:
duration- timeout before object will be deleted- Returns:
trueif the timeout was set andfalseif not
-
expireIfSetAsync
Description copied from interface:RExpirableAsyncSets a timeout for this object only if it has been already set. After the timeout has expired, the key will automatically be deleted.Requires Redis 7.0.0 and higher.
- Specified by:
expireIfSetAsyncin interfaceRExpirableAsync- Parameters:
duration- timeout before object will be deleted- Returns:
trueif the timeout was set andfalseif not
-
expireIfNotSet
Description copied from interface:RExpirableSets a timeout for this object only if it hasn't been set before. After the timeout has expired, the key will automatically be deleted.Requires Redis 7.0.0 and higher.
- Specified by:
expireIfNotSetin interfaceRExpirable- Parameters:
duration- timeout before object will be deleted- Returns:
trueif the timeout was set andfalseif not
-
expireIfNotSetAsync
Description copied from interface:RExpirableAsyncSets a timeout for this object only if it hasn't been set before. After the timeout has expired, the key will automatically be deleted.Requires Redis 7.0.0 and higher.
- Specified by:
expireIfNotSetAsyncin interfaceRExpirableAsync- Parameters:
duration- timeout before object will be deleted- Returns:
trueif the timeout was set andfalseif not
-
expireIfGreater
Description copied from interface:RExpirableSets a timeout for this object only if it's greater than timeout set before. After the timeout has expired, the key will automatically be deleted.Requires Redis 7.0.0 and higher.
- Specified by:
expireIfGreaterin interfaceRExpirable- Parameters:
duration- timeout before object will be deleted- Returns:
trueif the timeout was set andfalseif not
-
expireIfGreaterAsync
Description copied from interface:RExpirableAsyncSets a timeout for this object only if it's greater than timeout set before. After the timeout has expired, the key will automatically be deleted.Requires Redis 7.0.0 and higher.
- Specified by:
expireIfGreaterAsyncin interfaceRExpirableAsync- Parameters:
duration- timeout before object will be deleted- Returns:
trueif the timeout was set andfalseif not
-
expireIfLess
Description copied from interface:RExpirableSets a timeout for this object only if it's less than timeout set before. After the timeout has expired, the key will automatically be deleted.Requires Redis 7.0.0 and higher.
- Specified by:
expireIfLessin interfaceRExpirable- Parameters:
duration- timeout before object will be deleted- Returns:
trueif the timeout was set andfalseif not
-
expireIfLessAsync
Description copied from interface:RExpirableAsyncSets a timeout for this object only if it's less than timeout set before. After the timeout has expired, the key will automatically be deleted.Requires Redis 7.0.0 and higher.
- Specified by:
expireIfLessAsyncin interfaceRExpirableAsync- Parameters:
duration- timeout before object will be deleted- Returns:
trueif the timeout was set andfalseif not
-
clearExpire
public boolean clearExpire()Description copied from interface:RExpirableClear an expire timeout or expire date for object.- Specified by:
clearExpirein interfaceRExpirable- Returns:
trueif timeout was removedfalseif object does not exist or does not have an associated timeout
-
clearExpireAsync
Description copied from interface:RExpirableAsyncClear an expire timeout or expire date for object in async mode. Object will not be deleted.- Specified by:
clearExpireAsyncin interfaceRExpirableAsync- Returns:
trueif the timeout was cleared andfalseif not
-
remainTimeToLive
public long remainTimeToLive()Description copied from interface:RExpirableRemaining time to live of Redisson object that has a timeout- Specified by:
remainTimeToLivein interfaceRExpirable- Returns:
- time in milliseconds -2 if the key does not exist. -1 if the key exists but has no associated expire.
-
remainTimeToLiveAsync
Description copied from interface:RExpirableAsyncRemaining time to live of Redisson object that has a timeout- Specified by:
remainTimeToLiveAsyncin interfaceRExpirableAsync- Returns:
- time in milliseconds -2 if the key does not exist. -1 if the key exists but has no associated expire.
-
getExpireTime
public long getExpireTime()Description copied from interface:RExpirableExpiration time of Redisson object that has a timeoutRequires Redis 7.0.0 and higher.
- Specified by:
getExpireTimein interfaceRExpirable- Returns:
- expiration time
-
getExpireTimeAsync
Description copied from interface:RExpirableAsyncExpiration time of Redisson object that has a timeoutRequires Redis 7.0.0 and higher.
- Specified by:
getExpireTimeAsyncin interfaceRExpirableAsync- Returns:
- expiration time
-
expireAsync
-
expireAtAsync
-
clearExpireAsync
-