Package org.redisson.api
Interface RBucketReactive<V>
-
- Type Parameters:
V- - the type of object
- All Superinterfaces:
RExpirableReactive,RObjectReactive
- All Known Subinterfaces:
RBinaryStreamReactive
public interface RBucketReactive<V> extends RExpirableReactive
Reactive implementation of object holder. Max size of object is 512MB- Author:
- Nikita Koksharov
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description reactor.core.publisher.Mono<Boolean>compareAndSet(V expect, V update)Atomically sets the value to the given updated value only if serialized state of the current value equals to serialized state of the expected value.reactor.core.publisher.Mono<V>get()Retrieves element stored in the holder.reactor.core.publisher.Mono<V>getAndDelete()Retrieves element in the holder and removes it.reactor.core.publisher.Mono<V>getAndSet(V newValue)Retrieves current element in the holder and replaces it withnewValue.reactor.core.publisher.Mono<V>getAndSet(V value, long timeToLive, TimeUnit timeUnit)Retrieves current element in the holder and replaces it withnewValuewith definedtimeToLiveinterval.reactor.core.publisher.Mono<Void>set(V value)Stores element into the holder.reactor.core.publisher.Mono<Void>set(V value, long timeToLive, TimeUnit timeUnit)Stores element into the holder with definedtimeToLiveinterval.reactor.core.publisher.Mono<Void>setAndKeepTTL(V value)Set value and keep existing TTL.reactor.core.publisher.Mono<Boolean>setIfExists(V value)Sets value only if it's already exists.reactor.core.publisher.Mono<Boolean>setIfExists(V value, long timeToLive, TimeUnit timeUnit)Sets value only if it's already exists.reactor.core.publisher.Mono<Long>size()Returns size of object in bytesreactor.core.publisher.Mono<Boolean>trySet(V value)Tries to set element atomically into empty holder.reactor.core.publisher.Mono<Boolean>trySet(V value, long timeToLive, TimeUnit timeUnit)Tries to set element atomically into empty holder with definedtimeToLiveinterval.-
Methods inherited from interface org.redisson.api.RExpirableReactive
clearExpire, expire, expireAt, expireAt, expireAt, 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 Detail
-
size
reactor.core.publisher.Mono<Long> size()
Returns size of object in bytes- Returns:
- object size
-
trySet
reactor.core.publisher.Mono<Boolean> trySet(V value)
Tries to set element atomically into empty holder.- Parameters:
value- - value to set- Returns:
trueif successful, orfalseif element was already set
-
trySet
reactor.core.publisher.Mono<Boolean> trySet(V value, long timeToLive, TimeUnit timeUnit)
Tries to set element atomically into empty holder with definedtimeToLiveinterval.- Parameters:
value- - value to settimeToLive- - time to live intervaltimeUnit- - unit of time to live interval- Returns:
trueif successful, orfalseif element was already set
-
setIfExists
reactor.core.publisher.Mono<Boolean> setIfExists(V value)
Sets value only if it's already exists.- Parameters:
value- - value to set- Returns:
trueif successful, orfalseif element wasn't set
-
setIfExists
reactor.core.publisher.Mono<Boolean> setIfExists(V value, long timeToLive, TimeUnit timeUnit)
Sets value only if it's already exists.- Parameters:
value- - value to settimeToLive- - time to live intervaltimeUnit- - unit of time to live interval- Returns:
trueif successful, orfalseif element wasn't set
-
compareAndSet
reactor.core.publisher.Mono<Boolean> compareAndSet(V expect, V update)
Atomically sets the value to the given updated value only if serialized state of the current value equals to serialized state of the expected value.- Parameters:
expect- the expected valueupdate- the new value- Returns:
trueif successful; orfalseif the actual value was not equal to the expected value.
-
getAndSet
reactor.core.publisher.Mono<V> getAndSet(V newValue)
Retrieves current element in the holder and replaces it withnewValue.- Parameters:
newValue- - value to set- Returns:
- previous value
-
getAndSet
reactor.core.publisher.Mono<V> getAndSet(V value, long timeToLive, TimeUnit timeUnit)
Retrieves current element in the holder and replaces it withnewValuewith definedtimeToLiveinterval.- Parameters:
value- - value to settimeToLive- - time to live intervaltimeUnit- - unit of time to live interval- Returns:
- previous value
-
get
reactor.core.publisher.Mono<V> get()
Retrieves element stored in the holder.- Returns:
- element
-
getAndDelete
reactor.core.publisher.Mono<V> getAndDelete()
Retrieves element in the holder and removes it.- Returns:
- element
-
set
reactor.core.publisher.Mono<Void> set(V value)
Stores element into the holder.- Parameters:
value- - value to set- Returns:
- void
-
set
reactor.core.publisher.Mono<Void> set(V value, long timeToLive, TimeUnit timeUnit)
Stores element into the holder with definedtimeToLiveinterval.- Parameters:
value- - value to settimeToLive- - time to live intervaltimeUnit- - unit of time to live interval- Returns:
- void
-
-