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>
public interface RQueueRx<V> extends RCollectionRx<V>
RxJava2 interface for Queue object- Author:
- Nikita Koksharov
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description io.reactivex.rxjava3.core.Single<Boolean>
offer(V e)
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.io.reactivex.rxjava3.core.Single<List<V>>
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
.io.reactivex.rxjava3.core.Single<List<V>>
readAll()
Returns all queue elements at once-
Methods 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, expireAt, expireAt, expireAt, remainTimeToLive
-
Methods inherited from interface org.redisson.api.RObjectRx
addListener, copy, delete, dump, getCodec, getIdleTime, getName, isExists, migrate, move, removeListener, rename, renamenx, restore, restore, restoreAndReplace, restoreAndReplace, sizeInMemory, touch, unlink
-
-
-
-
Method Detail
-
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
io.reactivex.rxjava3.core.Single<List<V>> poll(int limit)
Retrieves and removes the head elements of this queue. Elements amount limited bylimit
param.- Returns:
- list of head elements
-
offer
io.reactivex.rxjava3.core.Single<Boolean> offer(V e)
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
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
.- 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
-
-