Package org.redisson.api
Interface RQueueReactive<V>
- Type Parameters:
V
- the type of elements held in this collection
- All Superinterfaces:
RCollectionReactive<V>
,RExpirableReactive
,RObjectReactive
- All Known Subinterfaces:
RBlockingDequeReactive<V>
,RBlockingQueueReactive<V>
,RDequeReactive<V>
,RRingBufferReactive<V>
,RTransferQueueReactive<V>
Reactive interface for Queue object
- Author:
- Nikita Koksharov
-
Method Summary
Modifier and TypeMethodDescriptionreactor.core.publisher.Mono<Boolean>
Inserts the specified element into this queue.reactor.core.publisher.Mono<V>
peek()
Retrieves the head of this queue in async mode.reactor.core.publisher.Mono<V>
poll()
Retrieves and removes the head of this queue in async mode.poll
(int limit) Retrieves and removes the head elements of this queue.reactor.core.publisher.Mono<V>
pollLastAndOfferFirstTo
(String queueName) Retrieves and removes last available tail element of this queue queue and adds it at the head ofqueueName
.readAll()
Returns all queue elements at onceMethods inherited from interface org.redisson.api.RCollectionReactive
add, addAll, addAll, contains, containsAll, iterator, remove, removeAll, retainAll, size
Methods inherited from interface org.redisson.api.RExpirableReactive
clearExpire, expire, expire, expire, expireAt, expireAt, expireIfGreater, expireIfGreater, expireIfLess, expireIfLess, expireIfNotSet, expireIfNotSet, expireIfSet, expireIfSet, getExpireTime, remainTimeToLive
Methods inherited from interface org.redisson.api.RObjectReactive
addListener, copy, delete, dump, getCodec, getIdleTime, getName, isExists, migrate, move, removeListener, rename, renamenx, restore, restore, restoreAndReplace, restoreAndReplace, sizeInMemory, touch, unlink
-
Method Details
-
peek
reactor.core.publisher.Mono<V> peek()Retrieves the head of this queue in async mode.- Returns:
- the head of this queue, or
null
-
poll
reactor.core.publisher.Mono<V> poll()Retrieves and removes the head of this queue in async mode.- Returns:
- the head of this queue, or
null
-
poll
Retrieves and removes the head elements of this queue. Elements amount limited bylimit
param.- Returns:
- list of head elements
-
offer
Inserts the specified element into this queue.- Parameters:
e
- the element to add- Returns:
true
if successful, orfalse
- Throws:
ClassCastException
- if the class of the specified element prevents it from being added to this queueNullPointerException
- if the specified element is null
-
pollLastAndOfferFirstTo
Retrieves and removes last available tail element of this queue queue and adds it at the head ofqueueName
.- 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
-
readAll
Returns all queue elements at once- Returns:
- elements
-