public class RedissonBlockingQueueReactive<V> extends RedissonQueueReactive<V> implements RBlockingQueueReactive<V>
Distributed and concurrent implementation of BlockingQueue
.
Queue size limited by Redis server memory amount.
Constructor and Description |
---|
RedissonBlockingQueueReactive(Codec codec,
CommandReactiveExecutor commandExecutor,
String name) |
RedissonBlockingQueueReactive(CommandReactiveExecutor commandExecutor,
String name) |
Modifier and Type | Method and Description |
---|---|
org.reactivestreams.Publisher<Boolean> |
clearExpire()
Clear an expire timeout or expire date for object in mode.
|
org.reactivestreams.Publisher<Boolean> |
delete()
Delete object in mode
|
org.reactivestreams.Publisher<Integer> |
drainTo(Collection<? super V> c) |
org.reactivestreams.Publisher<Integer> |
drainTo(Collection<? super V> c,
int maxElements) |
protected void |
encode(Collection<Object> params,
Collection<?> values) |
protected io.netty.buffer.ByteBuf |
encode(Object value) |
protected io.netty.buffer.ByteBuf |
encodeMapKey(Object value) |
protected io.netty.buffer.ByteBuf |
encodeMapValue(Object value) |
org.reactivestreams.Publisher<Boolean> |
expire(long timeToLive,
TimeUnit timeUnit)
Set a timeout for object in mode.
|
org.reactivestreams.Publisher<Boolean> |
expireAt(Date timestamp)
Set an expire date for object in mode.
|
org.reactivestreams.Publisher<Boolean> |
expireAt(long timestamp)
Set an expire date for object in mode.
|
Codec |
getCodec() |
String |
getName() |
org.reactivestreams.Publisher<Boolean> |
isExists()
Check object existence
|
org.reactivestreams.Publisher<Void> |
migrate(String host,
int port,
int database,
long timeout)
Transfer a object from a source Redis instance to a destination Redis instance
in mode
|
org.reactivestreams.Publisher<Boolean> |
move(int database)
Move object to another database in mode
|
protected <V> reactor.core.publisher.Mono<V> |
newSucceeded(V result) |
org.reactivestreams.Publisher<V> |
poll(long timeout,
TimeUnit unit) |
org.reactivestreams.Publisher<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.
|
org.reactivestreams.Publisher<V> |
pollLastAndOfferFirstTo(String queueName,
long timeout,
TimeUnit unit) |
org.reactivestreams.Publisher<Integer> |
put(V e) |
<R> org.reactivestreams.Publisher<R> |
reactive(Supplier<RFuture<R>> supplier) |
org.reactivestreams.Publisher<Long> |
remainTimeToLive()
Get remaining time to live of object in milliseconds.
|
org.reactivestreams.Publisher<Void> |
rename(String newName)
Rename current object key to
newName
in mode |
org.reactivestreams.Publisher<Boolean> |
renamenx(String newName)
Rename current object key to
newName
in mode only if new key is not exists |
org.reactivestreams.Publisher<V> |
take() |
offer, peek, poll, pollLastAndOfferFirstTo
add, add, addAfter, addAll, addAll, addAll, addBefore, contains, containsAll, descendingIterator, descendingIterator, equals, fastRemove, fastSet, get, get, hashCode, indexOf, iterator, iterator, lastIndexOf, readAll, remove, remove, remove, removeAll, retainAll, set, size, trim
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
offer, peek, poll, pollLastAndOfferFirstTo
add, addAll, addAll, contains, containsAll, iterator, remove, removeAll, retainAll, size
clearExpire, expire, expireAt, expireAt, remainTimeToLive
public RedissonBlockingQueueReactive(CommandReactiveExecutor commandExecutor, String name)
public RedissonBlockingQueueReactive(Codec codec, CommandReactiveExecutor commandExecutor, String name)
public org.reactivestreams.Publisher<Integer> put(V e)
put
in interface RBlockingQueueReactive<V>
public org.reactivestreams.Publisher<V> take()
take
in interface RBlockingQueueReactive<V>
public org.reactivestreams.Publisher<V> poll(long timeout, TimeUnit unit)
poll
in interface RBlockingQueueReactive<V>
public org.reactivestreams.Publisher<V> pollFromAny(long timeout, TimeUnit unit, String... queueNames)
RBlockingQueueReactive
pollFromAny
in interface RBlockingQueueReactive<V>
timeout
- how long to wait before giving up, in units of
unit
unit
- a TimeUnit
determining how to interpret the
timeout
parameterqueueNames
- - names of queuenull
if the
specified waiting time elapses before an element is availablepublic org.reactivestreams.Publisher<V> pollLastAndOfferFirstTo(String queueName, long timeout, TimeUnit unit)
pollLastAndOfferFirstTo
in interface RBlockingQueueReactive<V>
public org.reactivestreams.Publisher<Integer> drainTo(Collection<? super V> c)
drainTo
in interface RBlockingQueueReactive<V>
public org.reactivestreams.Publisher<Integer> drainTo(Collection<? super V> c, int maxElements)
drainTo
in interface RBlockingQueueReactive<V>
public org.reactivestreams.Publisher<Boolean> expire(long timeToLive, TimeUnit timeUnit)
RExpirableReactive
expire
in interface RExpirableReactive
timeToLive
- - timeout before object will be deletedtimeUnit
- - timeout time unittrue
if the timeout was set and false
if notpublic org.reactivestreams.Publisher<Boolean> expireAt(long timestamp)
RExpirableReactive
expireAt
in interface RExpirableReactive
timestamp
- - expire date in milliseconds (Unix timestamp)true
if the timeout was set and false
if notpublic org.reactivestreams.Publisher<Boolean> expireAt(Date timestamp)
RExpirableReactive
expireAt
in interface RExpirableReactive
timestamp
- - expire datetrue
if the timeout was set and false
if notpublic org.reactivestreams.Publisher<Boolean> clearExpire()
RExpirableReactive
clearExpire
in interface RExpirableReactive
true
if the timeout was cleared and false
if notpublic org.reactivestreams.Publisher<Long> remainTimeToLive()
RExpirableReactive
remainTimeToLive
in interface RExpirableReactive
protected <V> reactor.core.publisher.Mono<V> newSucceeded(V result)
public String getName()
getName
in interface RObjectReactive
public Codec getCodec()
getCodec
in interface RObjectReactive
protected void encode(Collection<Object> params, Collection<?> values)
protected io.netty.buffer.ByteBuf encode(Object value)
protected io.netty.buffer.ByteBuf encodeMapKey(Object value)
protected io.netty.buffer.ByteBuf encodeMapValue(Object value)
public org.reactivestreams.Publisher<Void> rename(String newName)
RObjectReactive
newName
in moderename
in interface RObjectReactive
newName
- - new name of objectpublic org.reactivestreams.Publisher<Void> migrate(String host, int port, int database, long timeout)
RObjectReactive
migrate
in interface RObjectReactive
host
- - destination hostport
- - destination portdatabase
- - destination databasetimeout
- - maximum idle time in any moment of the communication with the destination instance in millisecondspublic org.reactivestreams.Publisher<Boolean> move(int database)
RObjectReactive
move
in interface RObjectReactive
database
- - number of Redis databasetrue
if key was moved false
if notpublic org.reactivestreams.Publisher<Boolean> renamenx(String newName)
RObjectReactive
newName
in mode only if new key is not existsrenamenx
in interface RObjectReactive
newName
- - new name of objecttrue
if object has been renamed successfully and false
otherwisepublic org.reactivestreams.Publisher<Boolean> delete()
RObjectReactive
delete
in interface RObjectReactive
true
if object was deleted false
if notpublic org.reactivestreams.Publisher<Boolean> isExists()
RObjectReactive
isExists
in interface RObjectReactive
true
if object exists and false
otherwiseCopyright © 2014–2018 The Redisson Project. All rights reserved.