Package org.redisson.api
Interface RQueueRx<V>
- Type Parameters:
V
- the type of elements held in this collection
- All Superinterfaces:
RCollectionRx<V>
,RExpirableRx
,RObjectRx
- All Known Subinterfaces:
RBlockingDequeRx<V>
,RBlockingQueueRx<V>
,RDequeRx<V>
,RRingBufferRx<V>
,RTransferQueueRx<V>
RxJava2 interface for Queue object
- Author:
- Nikita Koksharov
-
Method Summary
Modifier and TypeMethodDescriptionio.reactivex.rxjava3.core.Single
<Integer> addListener
(ObjectListener listener) Adds object event listenerio.reactivex.rxjava3.core.Single
<Boolean> Inserts the specified element into this queue.io.reactivex.rxjava3.core.Maybe
<V> peek()
Retrieves the head of this queue in async mode.io.reactivex.rxjava3.core.Maybe
<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.io.reactivex.rxjava3.core.Maybe
<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.RCollectionRx
add, addAll, addAll, contains, containsAll, iterator, remove, removeAll, retainAll, size
Methods inherited from interface org.redisson.api.RExpirableRx
clearExpire, expire, expire, expire, expireAt, expireAt, expireIfGreater, expireIfGreater, expireIfLess, expireIfLess, expireIfNotSet, expireIfNotSet, expireIfSet, expireIfSet, getExpireTime, remainTimeToLive
Methods inherited from interface org.redisson.api.RObjectRx
copy, delete, dump, getCodec, getIdleTime, getName, isExists, migrate, move, removeListener, rename, renamenx, restore, restore, restoreAndReplace, restoreAndReplace, sizeInMemory, touch, unlink
-
Method Details
-
peek
io.reactivex.rxjava3.core.Maybe<V> peek()Retrieves the head of this queue in async mode.- Returns:
- the head of this queue, or
null
-
poll
io.reactivex.rxjava3.core.Maybe<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
-
addListener
Adds object event listener- Specified by:
addListener
in interfaceRObjectRx
- Parameters:
listener
- - object event listener- Returns:
- listener id
- See Also:
-