Package org.redisson
Class RedissonBlockingDeque<V>
-
- org.redisson.RedissonObject
-
- org.redisson.RedissonList<V>
-
- org.redisson.RedissonQueue<V>
-
- org.redisson.RedissonDeque<V>
-
- org.redisson.RedissonBlockingDeque<V>
-
- All Implemented Interfaces:
<V>
,<V>
,<V>
,<V>
,<V>
,<V>
,<V>
,,
<V>>
,<V>>
public class RedissonBlockingDeque<V> extends RedissonDeque<V> implements RBlockingDeque<V>
Distributed and concurrent implementation of .
Queue size limited by Redis server memory amount. This is why
remainingCapacity()
always returnsInteger.MAX_VALUE
- Author:
- Nikita Koksharov
-
-
Field Summary
-
Fields inherited from class org.redisson.RedissonObject
codec, commandExecutor, name
-
-
Constructor Summary
Constructors Constructor Description RedissonBlockingDeque(Codec codec, CommandAsyncExecutor commandExecutor, name, RedissonClient redisson)
RedissonBlockingDeque(CommandAsyncExecutor commandExecutor, name, RedissonClient redisson)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
clearExpire()
Clear an expire timeout or expire date for object.>
clearExpireAsync()
Clear an expire timeout or expire date for object in async mode.protected >
... keys)
int
<? super V> c)
int
<? super V> c, int maxElements)
>
<? super V> c)
Removes all available elements from this queue and adds them to the given collection in async mode.>
<? 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.boolean
expire(long timeToLive, timeUnit)
Set a timeout for object.boolean
instant)
Set an expire date for object.>
expireAsync(long timeToLive, timeUnit)
Set a timeout for object in async mode.protected >
expireAsync(long timeToLive, timeUnit, ... keys)
>
instant)
Set an expire date for object.boolean
expireAt(long timestamp)
UseRExpirable.expire(Instant)
insteadboolean
timestamp)
UseRExpirable.expire(Instant)
instead>
expireAtAsync(long timestamp)
UseRExpirableAsync.expireAsync(Instant)
insteadprotected >
expireAtAsync(long timestamp, ... keys)
>
timestamp)
UseRExpirableAsync.expireAsync(Instant)
insteadV
timeout, DequeMoveArgs args)
RFuture<V>
timeout, DequeMoveArgs args)
boolean
offer(V e, long timeout, unit)
boolean
offerFirst(V e, long timeout, unit)
boolean
offerLast(V e, long timeout, unit)
V
poll(long timeout, unit)
RFuture<V>
pollAsync(long timeout, unit)
Retrieves 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.V
pollFirst(long timeout, unit)
RFuture<V>
pollFirstAsync(long timeout, unit)
Retrieves and removes value at the head of queue.V
pollFirstFromAny(long timeout, unit, ... 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.RFuture<V>
pollFirstFromAnyAsync(long timeout, unit, ... 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.V
pollFromAny(long timeout, unit, ... 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.RFuture<V>
pollFromAnyAsync(long timeout, unit, ... 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.V
pollLast(long timeout, unit)
V
queueName, long timeout, 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.RFuture<V>
queueName, long timeout, 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.RFuture<V>
pollLastAsync(long timeout, unit)
Retrieves and removes value at the tail of queue.V
pollLastFromAny(long timeout, unit, ... 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.RFuture<V>
pollLastFromAnyAsync(long timeout, unit, ... 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.void
put(V e)
>
putAsync(V e)
Inserts the specified element into this queue in async mode, waiting if necessary for space to become available.void
putFirst(V e)
>
putFirstAsync(V e)
Adds value to the head of queue.void
putLast(V e)
>
putLastAsync(V e)
Adds value to the tail of queue.int
remainingCapacity()
long
remainTimeToLive()
Remaining time to live of Redisson object that has a timeout>
remainTimeToLiveAsync()
Remaining time to live of Redisson object that has a timeoutint
<V> consumer)
Subscribes on elements appeared in this queue.int
<V> consumer)
Subscribes on first elements appeared in this queue.int
<V> consumer)
Subscribes on last elements appeared in this queue.V
take()
RFuture<V>
takeAsync()
Retrieves and removes the head of this queue in async mode, waiting if necessary until an element becomes available.V
takeFirst()
RFuture<V>
takeFirstAsync()
Retrieves and removes value at the head of queue.V
takeLast()
V
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.RFuture<V>
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.RFuture<V>
takeLastAsync()
Retrieves and removes value at the tail of queue.void
unsubscribe(int id)
Un-subscribes defined listener.-
Methods inherited from class org.redisson.RedissonDeque
addFirst, addFirstAsync, addFirstIfExists, addFirstIfExistsAsync, addLast, 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
-
Methods inherited from class org.redisson.RedissonQueue
element, getFirst, offer, offerAsync, peek, peekAsync, poll, poll, pollAsync, pollAsync, pollLastAndOfferFirstTo, pollLastAndOfferFirstToAsync, remove, removeFirst
-
Methods 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, 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, trimAsync
-
Methods inherited from class org.redisson.RedissonObject
addListener, addListenerAsync, copy, copyAsync, delete, deleteAsync, deleteAsync, dump, dumpAsync, encode, encode, encode, encode, encodeMapKey, encodeMapKeys, encodeMapValue, encodeMapValues, get, getCodec, getIdleTime, getIdleTimeAsync, getLockByMapKey, getLockByValue, getName, getRawName, getRawName, isExists, isExistsAsync, migrate, migrateAsync, move, moveAsync, prefixName, removeListenersAsync, rename, renameAsync, renamenx, renamenxAsync, restore, restore, restoreAndReplace, restoreAndReplace, restoreAndReplaceAsync, restoreAndReplaceAsync, restoreAsync, restoreAsync, setName, sizeInMemory, sizeInMemoryAsync, sizeInMemoryAsync, sizeInMemoryAsync, suffixName, toSeconds, toStream, touch, touchAsync, unlink, unlinkAsync
-
Methods inherited from interface org.redisson.api.RCollectionAsync
addAllAsync, addAsync, containsAllAsync, containsAsync, removeAllAsync, removeAsync, retainAllAsync, sizeAsync
-
Methods inherited from interface org.redisson.api.RDeque
addFirstIfExists, addLastIfExists, move, pollFirst, pollLast
-
Methods inherited from interface org.redisson.api.RDequeAsync
addFirstAsync, addFirstIfExistsAsync, 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, expireAt, expireAt, remainTimeToLive
-
Methods inherited from interface org.redisson.api.RExpirableAsync
clearExpireAsync, expireAsync, expireAsync, expireAtAsync, expireAtAsync, 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
-
-
-
-
Constructor Detail
-
RedissonBlockingDeque
public RedissonBlockingDeque(CommandAsyncExecutor commandExecutor, name, RedissonClient redisson)
-
RedissonBlockingDeque
public RedissonBlockingDeque(Codec codec, CommandAsyncExecutor commandExecutor, name, RedissonClient redisson)
-
-
Method Detail
-
putAsync
public > putAsync(V e)
Description copied from interface:RBlockingQueueAsync
Inserts the specified element into this queue in async mode, waiting if necessary for space to become available.- Specified by:
putAsync
in interfaceRBlockingQueueAsync<V>
- Parameters:
e
- the element to add- Returns:
- void
-
put
public void put(V e) throws
-
offer
public boolean offer(V e, long timeout, unit) throws
-
takeAsync
public RFuture<V> takeAsync()
Description copied from interface:RBlockingQueueAsync
Retrieves and removes the head of this queue in async mode, waiting if necessary until an element becomes available.- Specified by:
takeAsync
in interfaceRBlockingQueueAsync<V>
- Returns:
- the head of this queue
-
pollAsync
public RFuture<V> pollAsync(long timeout, unit)
Description copied from interface:RBlockingQueueAsync
Retrieves 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:
pollAsync
in interfaceRBlockingQueueAsync<V>
- Parameters:
timeout
- 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
-
poll
public V poll(long timeout, unit) throws
-
pollFromAny
public V pollFromAny(long timeout, unit, ... queueNames) throws
Description copied from interface:RBlockingQueue
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.- Specified by:
pollFromAny
in interfaceRBlockingQueue<V>
- Parameters:
timeout
- how long to wait before giving up, in units ofunit
unit
- aTimeUnit
determining how to interpret thetimeout
parameterqueueNames
- - queue names. Queue name itself is always included- Returns:
- the head of this queue, or
null
if the specified waiting time elapses before an element is available - Throws:
- if interrupted while waiting
-
pollFromAnyAsync
public RFuture<V> pollFromAnyAsync(long timeout, unit, ... queueNames)
Description copied from interface:RBlockingQueueAsync
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.- Specified by:
pollFromAnyAsync
in interfaceRBlockingQueueAsync<V>
- Parameters:
timeout
- how long to wait before giving up, in units ofunit
unit
- aTimeUnit
determining how to interpret thetimeout
parameterqueueNames
- - queue names. Queue name itself is always included- Returns:
- Future object with the head of this queue, or
null
if the specified waiting time elapses before an element is available
-
pollLastAndOfferFirstToAsync
public queueName, long timeout, unit)
Description copied from interface:RBlockingQueueAsync
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.- Specified by:
pollLastAndOfferFirstToAsync
in interfaceRBlockingQueueAsync<V>
- 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
-
pollLastAndOfferFirstTo
public queueName, long timeout, unit) throws
Description copied from interface:RBlockingQueue
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.- Specified by:
pollLastAndOfferFirstTo
in interfaceRBlockingQueue<V>
- 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:
- if interrupted while waiting
-
takeLastAndOfferFirstTo
public queueName) throws
Description copied from interface:RBlockingQueue
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.- Specified by:
takeLastAndOfferFirstTo
in interfaceRBlockingQueue<V>
- 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:
- if interrupted while waiting
-
subscribeOnElements
public int subscribeOnElements(<V> consumer)
Description copied from interface:RBlockingQueue
Subscribes on elements appeared in this queue. Continuously invokesRBlockingQueueAsync.takeAsync()
method to get a new element.- Specified by:
subscribeOnElements
in interfaceRBlockingQueue<V>
- Parameters:
consumer
- - queue elements listener- Returns:
- listenerId - id of listener
-
unsubscribe
public void unsubscribe(int id)
Description copied from interface:RBlockingQueue
Un-subscribes defined listener.- Specified by:
unsubscribe
in interfaceRBlockingQueue<V>
- Parameters:
id
- - id of listener
-
takeLastAndOfferFirstToAsync
public queueName)
Description copied from interface:RBlockingQueueAsync
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.- Specified by:
takeLastAndOfferFirstToAsync
in interfaceRBlockingQueueAsync<V>
- 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
-
remainingCapacity
public int remainingCapacity()
- Specified by:
in interface
<V>
-
drainToAsync
public > drainToAsync(<? super V> c)
Description copied from interface:RBlockingQueueAsync
Removes 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 collectionc
may 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:
drainToAsync
in interfaceRBlockingQueueAsync<V>
- Parameters:
c
- the collection to transfer elements into- Returns:
- the number of elements transferred
-
drainToAsync
public > drainToAsync(<? super V> c, int maxElements)
Description copied from interface:RBlockingQueueAsync
Removes 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 collectionc
may 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:
drainToAsync
in interfaceRBlockingQueueAsync<V>
- Parameters:
c
- the collection to transfer elements intomaxElements
- the maximum number of elements to transfer- Returns:
- the number of elements transferred
-
putFirstAsync
public > putFirstAsync(V e)
Description copied from interface:RBlockingDequeAsync
Adds value to the head of queue.- Specified by:
putFirstAsync
in interfaceRBlockingDequeAsync<V>
- Parameters:
e
- value- Returns:
- void
-
putLastAsync
public > putLastAsync(V e)
Description copied from interface:RBlockingDequeAsync
Adds value to the tail of queue.- Specified by:
putLastAsync
in interfaceRBlockingDequeAsync<V>
- Parameters:
e
- value- Returns:
- void
-
offerFirst
public boolean offerFirst(V e, long timeout, unit) throws
- Specified by:
in interface
<V>
- Throws:
-
offerLast
public boolean offerLast(V e, long timeout, unit) throws
- Specified by:
in interface
<V>
- Throws:
-
takeFirstAsync
public RFuture<V> takeFirstAsync()
Description copied from interface:RBlockingDequeAsync
Retrieves and removes value at the head of queue. Waits for an element become available.- Specified by:
takeFirstAsync
in interfaceRBlockingDequeAsync<V>
- Returns:
- the head element of this queue
-
takeLastAsync
public RFuture<V> takeLastAsync()
Description copied from interface:RBlockingDequeAsync
Retrieves and removes value at the tail of queue. Waits for an element become available.- Specified by:
takeLastAsync
in interfaceRBlockingDequeAsync<V>
- Returns:
- the tail element of this queue
-
pollFirstAsync
public RFuture<V> pollFirstAsync(long timeout, unit)
Description copied from interface:RBlockingDequeAsync
Retrieves and removes value at the head of queue. If necessary waits up to definedtimeout
for an element become available.- Specified by:
pollFirstAsync
in interfaceRBlockingDequeAsync<V>
- Parameters:
timeout
- how long to wait before giving up, in units ofunit
unit
- aTimeUnit
determining how to interpret thetimeout
parameter- Returns:
- the element at the tail of this queue, or
null
if the specified waiting time elapses before an element is available
-
pollFirstFromAny
public V pollFirstFromAny(long timeout, unit, ... queueNames) throws
Description copied from interface:RBlockingDeque
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.- Specified by:
pollFirstFromAny
in interfaceRBlockingDeque<V>
- Parameters:
timeout
- how long to wait before giving up, in units ofunit
unit
- aTimeUnit
determining how to interpret thetimeout
parameterqueueNames
- - names of queue- Returns:
- the head of this queue, or
null
if the specified waiting time elapses before an element is available - Throws:
- if interrupted while waiting
-
pollFirstFromAnyAsync
public RFuture<V> pollFirstFromAnyAsync(long timeout, unit, ... queueNames)
Description copied from interface:RBlockingDequeAsync
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.- Specified by:
pollFirstFromAnyAsync
in interfaceRBlockingDequeAsync<V>
- Parameters:
timeout
- how long to wait before giving up, in units ofunit
unit
- aTimeUnit
determining how to interpret thetimeout
parameterqueueNames
- - names of queue- Returns:
- the head of this queue, or
null
if the specified waiting time elapses before an element is available
-
pollLastFromAny
public V pollLastFromAny(long timeout, unit, ... queueNames) throws
Description copied from interface:RBlockingDeque
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.- Specified by:
pollLastFromAny
in interfaceRBlockingDeque<V>
- Parameters:
timeout
- how long to wait before giving up, in units ofunit
unit
- aTimeUnit
determining how to interpret thetimeout
parameterqueueNames
- - names of queue- Returns:
- the head of this queue, or
null
if the specified waiting time elapses before an element is available - Throws:
- if interrupted while waiting
-
subscribeOnFirstElements
public int subscribeOnFirstElements(<V> consumer)
Description copied from interface:RBlockingDeque
Subscribes on first elements appeared in this queue. Continuously invokesRBlockingDequeAsync.takeFirstAsync()
method to get a new element.- Specified by:
subscribeOnFirstElements
in interfaceRBlockingDeque<V>
- Parameters:
consumer
- - queue elements listener- Returns:
- listenerId - id of listener
-
subscribeOnLastElements
public int subscribeOnLastElements(<V> consumer)
Description copied from interface:RBlockingDeque
Subscribes on last elements appeared in this queue. Continuously invokesRBlockingDequeAsync.takeLastAsync()
method to get a new element.- Specified by:
subscribeOnLastElements
in interfaceRBlockingDeque<V>
- Parameters:
consumer
- - queue elements listener- Returns:
- listenerId - id of listener
-
pollLastFromAnyAsync
public RFuture<V> pollLastFromAnyAsync(long timeout, unit, ... queueNames)
Description copied from interface:RBlockingDequeAsync
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.- Specified by:
pollLastFromAnyAsync
in interfaceRBlockingDequeAsync<V>
- Parameters:
timeout
- how long to wait before giving up, in units ofunit
unit
- aTimeUnit
determining how to interpret thetimeout
parameterqueueNames
- - names of queue- Returns:
- the head of this queue, or
null
if the specified waiting time elapses before an element is available
-
pollLastAsync
public RFuture<V> pollLastAsync(long timeout, unit)
Description copied from interface:RBlockingDequeAsync
Retrieves and removes value at the tail of queue. If necessary waits up to definedtimeout
for an element become available.- Specified by:
pollLastAsync
in interfaceRBlockingDequeAsync<V>
- Parameters:
timeout
- how long to wait before giving up, in units ofunit
unit
- aTimeUnit
determining how to interpret thetimeout
parameter- Returns:
- the element at the head of this queue, or
null
if the specified waiting time elapses before an element is available
-
move
public timeout, DequeMoveArgs args)
- Specified by:
move
in interfaceRBlockingDeque<V>
-
moveAsync
public timeout, DequeMoveArgs args)
- Specified by:
moveAsync
in interfaceRBlockingDequeAsync<V>
-
expire
public boolean expire(long timeToLive, timeUnit)
Description copied from interface:RExpirable
Set a timeout for object. After the timeout has expired, the key will automatically be deleted.- Specified by:
expire
in interfaceRExpirable
- Parameters:
timeToLive
- - timeout before object will be deletedtimeUnit
- - timeout time unit- Returns:
true
if the timeout was set andfalse
if not
-
expireAsync
public > expireAsync(long timeToLive, timeUnit)
Description copied from interface:RExpirableAsync
Set a timeout for object in async mode. After the timeout has expired, the key will automatically be deleted.- Specified by:
expireAsync
in interfaceRExpirableAsync
- Parameters:
timeToLive
- - timeout before object will be deletedtimeUnit
- - timeout time unit- Returns:
true
if the timeout was set andfalse
if not
-
expireAt
public boolean expireAt(long timestamp)
Description copied from interface:RExpirable
UseRExpirable.expire(Instant)
instead- Specified by:
expireAt
in interfaceRExpirable
- Parameters:
timestamp
- - expire date in milliseconds (Unix timestamp)- Returns:
true
if the timeout was set andfalse
if not
-
expireAtAsync
public > expireAtAsync(long timestamp)
Description copied from interface:RExpirableAsync
UseRExpirableAsync.expireAsync(Instant)
instead- Specified by:
expireAtAsync
in interfaceRExpirableAsync
- Parameters:
timestamp
- - expire date in milliseconds (Unix timestamp)- Returns:
true
if the timeout was set andfalse
if not
-
expire
public boolean expire( instant)
Description copied from interface:RExpirable
Set an expire date for object. When expire date comes the key will automatically be deleted.- Specified by:
expire
in interfaceRExpirable
- Parameters:
instant
- - expire date- Returns:
true
if the timeout was set andfalse
if not
-
expireAsync
public > expireAsync( instant)
Description copied from interface:RExpirableAsync
Set an expire date for object. When expire date comes the key will automatically be deleted.- Specified by:
expireAsync
in interfaceRExpirableAsync
- Parameters:
instant
- - expire date- Returns:
true
if the timeout was set andfalse
if not
-
expireAt
public boolean expireAt( timestamp)
Description copied from interface:RExpirable
UseRExpirable.expire(Instant)
instead- Specified by:
expireAt
in interfaceRExpirable
- Parameters:
timestamp
- - expire date- Returns:
true
if the timeout was set andfalse
if not
-
expireAtAsync
public > expireAtAsync( timestamp)
Description copied from interface:RExpirableAsync
UseRExpirableAsync.expireAsync(Instant)
instead- Specified by:
expireAtAsync
in interfaceRExpirableAsync
- Parameters:
timestamp
- - expire date- Returns:
true
if the timeout was set andfalse
if not
-
clearExpire
public boolean clearExpire()
Description copied from interface:RExpirable
Clear an expire timeout or expire date for object.- Specified by:
clearExpire
in interfaceRExpirable
- Returns:
true
if timeout was removedfalse
if object does not exist or does not have an associated timeout
-
clearExpireAsync
public > clearExpireAsync()
Description copied from interface:RExpirableAsync
Clear an expire timeout or expire date for object in async mode. Object will not be deleted.- Specified by:
clearExpireAsync
in interfaceRExpirableAsync
- Returns:
true
if the timeout was cleared andfalse
if not
-
remainTimeToLive
public long remainTimeToLive()
Description copied from interface:RExpirable
Remaining time to live of Redisson object that has a timeout- Specified by:
remainTimeToLive
in interfaceRExpirable
- Returns:
- time in milliseconds -2 if the key does not exist. -1 if the key exists but has no associated expire.
-
remainTimeToLiveAsync
public > remainTimeToLiveAsync()
Description copied from interface:RExpirableAsync
Remaining time to live of Redisson object that has a timeout- Specified by:
remainTimeToLiveAsync
in interfaceRExpirableAsync
- Returns:
- time in milliseconds -2 if the key does not exist. -1 if the key exists but has no associated expire.
-
expireAsync
protected > expireAsync(long timeToLive, timeUnit, ... keys)
-
expireAtAsync
protected > expireAtAsync(long timestamp, ... keys)
-
clearExpireAsync
protected > clearExpireAsync(... keys)
-
-