V
- the type of elements held in this collectionpublic interface RBlockingQueueRx<V> extends RQueueRx<V>
Modifier and Type | Method and Description |
---|---|
io.reactivex.Single<Integer> |
drainTo(Collection<? super V> c)
Removes all available elements from this queue and adds them
to the given collection in async mode.
|
io.reactivex.Single<Integer> |
drainTo(Collection<? super V> c,
int maxElements)
Removes at most the given number of available elements from
this queue and adds them to the given collection in async mode.
|
io.reactivex.Maybe<V> |
poll(long timeout,
TimeUnit unit)
Retrieves and removes the head of this queue in async mode, waiting up to the
specified wait time if necessary for an element to become available.
|
io.reactivex.Maybe<V> |
pollFromAny(long timeout,
TimeUnit unit,
String... queueNames)
Retrieves and removes first available head element of any queue,
waiting up to the specified wait time if necessary for an element to become available
in any of defined queues including queue own.
|
io.reactivex.Maybe<V> |
pollLastAndOfferFirstTo(String queueName,
long timeout,
TimeUnit unit)
Retrieves and removes last available tail element of this queue and adds it at the head of
queueName ,
waiting up to the specified wait time if necessary for an element to become available. |
io.reactivex.Completable |
put(V e)
Inserts the specified element into this queue in async mode, waiting if necessary
for space to become available.
|
io.reactivex.Single<V> |
take()
Retrieves and removes the head of this queue in async mode, waiting if necessary
until an element becomes available.
|
io.reactivex.Flowable<V> |
takeElements()
Retrieves and removes continues stream of elements from the head of this queue.
|
io.reactivex.Single<V> |
takeLastAndOfferFirstTo(String queueName)
Retrieves and removes last available tail element of any queue and adds it at the head of
queueName ,
waiting if necessary for an element to become available
in any of defined queues including queue itself. |
offer, peek, poll, poll, pollLastAndOfferFirstTo, readAll
add, addAll, addAll, contains, containsAll, iterator, remove, removeAll, retainAll, size
clearExpire, expire, expireAt, expireAt, remainTimeToLive
addListener, copy, delete, dump, getCodec, getName, isExists, migrate, move, removeListener, rename, renamenx, restore, restore, restoreAndReplace, restoreAndReplace, sizeInMemory, touch, unlink
io.reactivex.Maybe<V> pollFromAny(long timeout, TimeUnit unit, String... queueNames)
queueNames
- - names of queuetimeout
- how long to wait before giving up, in units of
unit
unit
- a TimeUnit
determining how to interpret the
timeout
parameternull
if the
specified waiting time elapses before an element is availableio.reactivex.Single<Integer> drainTo(Collection<? super V> c, int maxElements)
c
may result in elements being in neither,
either or both collections when the associated exception is
thrown. Attempts to drain a queue to itself result in
IllegalArgumentException
. Further, the behavior of
this operation is undefined if the specified collection is
modified while the operation is in progress.c
- the collection to transfer elements intomaxElements
- the maximum number of elements to transferUnsupportedOperationException
- if addition of elements
is not supported by the specified collectionClassCastException
- if the class of an element of this queue
prevents it from being added to the specified collectionNullPointerException
- if the specified collection is nullIllegalArgumentException
- if the specified collection is this
queue, or some property of an element of this queue prevents
it from being added to the specified collectionio.reactivex.Single<Integer> drainTo(Collection<? super V> c)
c
may result in elements being in neither,
either or both collections when the associated exception is
thrown. Attempts to drain a queue to itself result in
IllegalArgumentException
. Further, the behavior of
this operation is undefined if the specified collection is
modified while the operation is in progress.c
- the collection to transfer elements intoUnsupportedOperationException
- if addition of elements
is not supported by the specified collectionClassCastException
- if the class of an element of this queue
prevents it from being added to the specified collectionNullPointerException
- if the specified collection is nullIllegalArgumentException
- if the specified collection is this
queue, or some property of an element of this queue prevents
it from being added to the specified collectionio.reactivex.Maybe<V> pollLastAndOfferFirstTo(String queueName, long timeout, TimeUnit unit)
queueName
,
waiting up to the specified wait time if necessary for an element to become available.queueName
- - names of destination queuetimeout
- how long to wait before giving up, in units of
unit
unit
- a TimeUnit
determining how to interpret the
timeout
parameternull
if the
specified waiting time elapses before an element is availableio.reactivex.Maybe<V> poll(long timeout, TimeUnit unit)
timeout
- how long to wait before giving up, in units of
unit
unit
- a TimeUnit
determining how to interpret the
timeout
parameternull
if the
specified waiting time elapses before an element is availableio.reactivex.Single<V> take()
io.reactivex.Single<V> takeLastAndOfferFirstTo(String queueName)
queueName
,
waiting if necessary for an element to become available
in any of defined queues including queue itself.queueName
- - names of destination queueio.reactivex.Completable put(V e)
e
- the element to addClassCastException
- if the class of the specified element
prevents it from being added to this queueNullPointerException
- if the specified element is nullIllegalArgumentException
- if some property of the specified
element prevents it from being added to this queueio.reactivex.Flowable<V> takeElements()
Copyright © 2014–2020 Redisson. All rights reserved.