Package org.redisson.api
Interface RDequeAsync<V>
- Type Parameters:
V
- the type of elements held in this collection
- All Superinterfaces:
RCollectionAsync<V>
,RExpirableAsync
,RObjectAsync
,RQueueAsync<V>
- All Known Subinterfaces:
RBlockingDeque<V>
,RBlockingDequeAsync<V>
,RDeque<V>
,RPriorityBlockingDeque<V>
,RPriorityDeque<V>
- All Known Implementing Classes:
RedissonBlockingDeque
,RedissonDeque
,RedissonPriorityBlockingDeque
,RedissonPriorityDeque
Distributed async implementation of
Deque
- Author:
- Nikita Koksharov
-
Method Summary
Modifier and TypeMethodDescriptionaddFirstAsync
(V e) Adds element at the head of this deque.addFirstAsync
(V... elements) Adds elements at the head of deque.addFirstIfExistsAsync
(V... elements) Adds element at the head of existing deque.addLastAsync
(V e) Adds element at the tail of this deque.addLastAsync
(V... elements) Adds elements at the tail of deque.addLastIfExistsAsync
(V... elements) Adds element at the tail of existing deque.Returns element at the tail of this deque ornull
if there are no elements in deque.moveAsync
(DequeMoveArgs args) Move element from this deque to the given destination deque.offerFirstAsync
(V e) Adds element at the head of this deque.offerLastAsync
(V e) Adds element at the tail of this deque.Returns element at the head of this deque ornull
if there are no elements in deque.Returns element at the tail of this deque ornull
if there are no elements in deque.Retrieves and removes element at the head of this deque.pollFirstAsync
(int limit) Retrieves and removes the head elements of this queue.Retrieves and removes element at the tail of this deque.pollLastAsync
(int limit) Retrieves and removes the tail elements of this queue.popAsync()
Retrieves and removes element at the head of this deque.Adds element at the head of this deque.Retrieves and removes the first element of deque.Removes first occurrence of elemento
Retrieves and removes the last element of deque.Removes last occurrence of elemento
Methods inherited from interface org.redisson.api.RCollectionAsync
addAllAsync, addAsync, containsAllAsync, containsAsync, removeAllAsync, removeAsync, retainAllAsync, sizeAsync
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.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.RQueueAsync
addListenerAsync, offerAsync, peekAsync, pollAsync, pollAsync, pollLastAndOfferFirstToAsync, readAllAsync
-
Method Details
-
addFirstIfExistsAsync
Adds element at the head of existing deque.- Parameters:
elements
- - elements to add- Returns:
- length of the list
-
addFirstAsync
Adds elements at the head of deque.- Parameters:
elements
- - elements to add- Returns:
- length of the deque
-
addLastIfExistsAsync
Adds element at the tail of existing deque.- Parameters:
elements
- - elements to add- Returns:
- length of the list
-
addLastAsync
Adds elements at the tail of deque.- Parameters:
elements
- - elements to add- Returns:
- length of the deque
-
removeLastOccurrenceAsync
Removes last occurrence of elemento
- Parameters:
o
- - element- Returns:
true
if object has been removed otherwisefalse
-
removeLastAsync
Retrieves and removes the last element of deque. Returnsnull
if there are no elements in deque.- Returns:
- element
-
removeFirstAsync
Retrieves and removes the first element of deque. Returnsnull
if there are no elements in deque.- Returns:
- element
-
removeFirstOccurrenceAsync
Removes first occurrence of elemento
- Parameters:
o
- - element to remove- Returns:
true
if object has been removed otherwisefalse
-
pushAsync
Adds element at the head of this deque.- Parameters:
e
- - element to add- Returns:
- void
-
popAsync
Retrieves and removes element at the head of this deque. Returnsnull
if there are no elements in deque.- Returns:
- element
-
pollLastAsync
Retrieves and removes element at the tail of this deque. Returnsnull
if there are no elements in deque.- Returns:
- element
-
pollFirstAsync
Retrieves and removes element at the head of this deque. Returnsnull
if there are no elements in deque.- Returns:
- element
-
peekLastAsync
Returns element at the tail of this deque ornull
if there are no elements in deque.- Returns:
- element
-
peekFirstAsync
Returns element at the head of this deque ornull
if there are no elements in deque.- Returns:
- element
-
offerLastAsync
Adds element at the tail of this deque.- Parameters:
e
- - element to add- Returns:
true
if element was added to this deque otherwisefalse
-
getLastAsync
Returns element at the tail of this deque ornull
if there are no elements in deque.- Returns:
- element
-
addLastAsync
Adds element at the tail of this deque.- Parameters:
e
- - element to add- Returns:
- void
-
addFirstAsync
Adds element at the head of this deque.- Parameters:
e
- - element to add- Returns:
- void
-
offerFirstAsync
Adds element at the head of this deque.- Parameters:
e
- - element to add- Returns:
true
if element was added to this deque otherwisefalse
-
pollFirstAsync
Retrieves and removes the head elements of this queue. Elements amount limited bylimit
param.- Returns:
- list of head elements
-
pollLastAsync
Retrieves and removes the tail elements of this queue. Elements amount limited bylimit
param.- Returns:
- list of tail elements
-
moveAsync
Move element from this deque to the given destination deque. Returns moved element.Usage examples:
V element = deque.move(DequeMoveArgs.pollLast() .addFirstTo("deque2"));
V elements = deque.move(DequeMoveArgs.pollFirst() .addLastTo("deque2"));
Requires Redis 6.2.0 and higher.
- Parameters:
args
- - arguments object- Returns:
- moved element
-