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
public interface RDequeAsync<V> extends RQueueAsync<V>
Distributed async implementation ofDeque- Author:
- Nikita Koksharov
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description RFuture<Void>addFirstAsync(V e)Adds element at the head of this deque.RFuture<Integer>addFirstIfExistsAsync(V... elements)Adds element at the head of existing deque.RFuture<Void>addLastAsync(V e)Adds element at the tail of this deque.RFuture<Integer>addLastIfExistsAsync(V... elements)Adds element at the tail of existing deque.RFuture<V>getLastAsync()Returns element at the tail of this deque ornullif there are no elements in deque.RFuture<V>moveAsync(DequeMoveArgs args)Move element from this deque to the given destination deque.RFuture<Boolean>offerFirstAsync(V e)Adds element at the head of this deque.RFuture<Boolean>offerLastAsync(V e)Adds element at the tail of this deque.RFuture<V>peekFirstAsync()Returns element at the head of this deque ornullif there are no elements in deque.RFuture<V>peekLastAsync()Returns element at the tail of this deque ornullif there are no elements in deque.RFuture<V>pollFirstAsync()Retrieves and removes element at the head of this deque.RFuture<List<V>>pollFirstAsync(int limit)Retrieves and removes the head elements of this queue.RFuture<V>pollLastAsync()Retrieves and removes element at the tail of this deque.RFuture<List<V>>pollLastAsync(int limit)Retrieves and removes the tail elements of this queue.RFuture<V>popAsync()Retrieves and removes element at the head of this deque.RFuture<Void>pushAsync(V e)Adds element at the head of this deque.RFuture<V>removeFirstAsync()Retrieves and removes the first element of deque.RFuture<Boolean>removeFirstOccurrenceAsync(Object o)Removes first occurrence of elementoRFuture<V>removeLastAsync()Retrieves and removes the last element of deque.RFuture<Boolean>removeLastOccurrenceAsync(Object o)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, expireAtAsync, expireAtAsync, 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 Detail
-
addFirstIfExistsAsync
RFuture<Integer> addFirstIfExistsAsync(V... elements)
Adds element at the head of existing deque.- Parameters:
elements- - elements to add- Returns:
- length of the list
-
addLastIfExistsAsync
RFuture<Integer> addLastIfExistsAsync(V... elements)
Adds element at the tail of existing deque.- Parameters:
elements- - elements to add- Returns:
- length of the list
-
removeLastOccurrenceAsync
RFuture<Boolean> removeLastOccurrenceAsync(Object o)
Removes last occurrence of elemento- Parameters:
o- - element- Returns:
trueif object has been removed otherwisefalse
-
removeLastAsync
RFuture<V> removeLastAsync()
Retrieves and removes the last element of deque. Returnsnullif there are no elements in deque.- Returns:
- element
-
removeFirstAsync
RFuture<V> removeFirstAsync()
Retrieves and removes the first element of deque. Returnsnullif there are no elements in deque.- Returns:
- element
-
removeFirstOccurrenceAsync
RFuture<Boolean> removeFirstOccurrenceAsync(Object o)
Removes first occurrence of elemento- Parameters:
o- - element to remove- Returns:
trueif object has been removed otherwisefalse
-
pushAsync
RFuture<Void> pushAsync(V e)
Adds element at the head of this deque.- Parameters:
e- - element to add- Returns:
- void
-
popAsync
RFuture<V> popAsync()
Retrieves and removes element at the head of this deque. Returnsnullif there are no elements in deque.- Returns:
- element
-
pollLastAsync
RFuture<V> pollLastAsync()
Retrieves and removes element at the tail of this deque. Returnsnullif there are no elements in deque.- Returns:
- element
-
pollFirstAsync
RFuture<V> pollFirstAsync()
Retrieves and removes element at the head of this deque. Returnsnullif there are no elements in deque.- Returns:
- element
-
peekLastAsync
RFuture<V> peekLastAsync()
Returns element at the tail of this deque ornullif there are no elements in deque.- Returns:
- element
-
peekFirstAsync
RFuture<V> peekFirstAsync()
Returns element at the head of this deque ornullif there are no elements in deque.- Returns:
- element
-
offerLastAsync
RFuture<Boolean> offerLastAsync(V e)
Adds element at the tail of this deque.- Parameters:
e- - element to add- Returns:
trueif element was added to this deque otherwisefalse
-
getLastAsync
RFuture<V> getLastAsync()
Returns element at the tail of this deque ornullif there are no elements in deque.- Returns:
- element
-
addLastAsync
RFuture<Void> addLastAsync(V e)
Adds element at the tail of this deque.- Parameters:
e- - element to add- Returns:
- void
-
addFirstAsync
RFuture<Void> addFirstAsync(V e)
Adds element at the head of this deque.- Parameters:
e- - element to add- Returns:
- void
-
offerFirstAsync
RFuture<Boolean> offerFirstAsync(V e)
Adds element at the head of this deque.- Parameters:
e- - element to add- Returns:
trueif element was added to this deque otherwisefalse
-
pollFirstAsync
RFuture<List<V>> pollFirstAsync(int limit)
Retrieves and removes the head elements of this queue. Elements amount limited bylimitparam.- Returns:
- list of head elements
-
pollLastAsync
RFuture<List<V>> pollLastAsync(int limit)
Retrieves and removes the tail elements of this queue. Elements amount limited bylimitparam.- Returns:
- list of tail elements
-
moveAsync
RFuture<V> moveAsync(DequeMoveArgs args)
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
-
-