Package org.redisson.api
Interface RBucketReactive<V>
-
- Type Parameters:
V
- - the type of object
- All Superinterfaces:
RExpirableReactive
,RObjectReactive
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 org.reactivestreams.Publisher<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.org.reactivestreams.Publisher<V>
get()
Retrieves element stored in the holder.org.reactivestreams.Publisher<V>
getAndDelete()
Retrieves element in the holder and removes it.org.reactivestreams.Publisher<V>
getAndSet(V newValue)
Retrieves current element in the holder and replaces it withnewValue
.org.reactivestreams.Publisher<Void>
set(V value)
Stores element into the holder.org.reactivestreams.Publisher<Void>
set(V value, long timeToLive, TimeUnit timeUnit)
Stores element into the holder with definedtimeToLive
interval.org.reactivestreams.Publisher<Long>
size()
Returns size of object in bytesorg.reactivestreams.Publisher<Boolean>
trySet(V value)
Tries to set element atomically into empty holder.org.reactivestreams.Publisher<Boolean>
trySet(V value, long timeToLive, TimeUnit timeUnit)
Tries to set element atomically into empty holder with definedtimeToLive
interval.-
Methods inherited from interface org.redisson.api.RExpirableReactive
clearExpire, expire, expireAt, expireAt, remainTimeToLive
-
-
-
-
Method Detail
-
size
org.reactivestreams.Publisher<Long> size()
Returns size of object in bytes- Returns:
- object size
-
trySet
org.reactivestreams.Publisher<Boolean> trySet(V value)
Tries to set element atomically into empty holder.- Parameters:
value
- - value to set- Returns:
true
if successful, orfalse
if element was already set
-
trySet
org.reactivestreams.Publisher<Boolean> trySet(V value, long timeToLive, TimeUnit timeUnit)
Tries to set element atomically into empty holder with definedtimeToLive
interval.- Parameters:
value
- - value to settimeToLive
- - time to live intervaltimeUnit
- - unit of time to live interval- Returns:
true
if successful, orfalse
if element was already set
-
compareAndSet
org.reactivestreams.Publisher<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:
true
if successful; orfalse
if the actual value was not equal to the expected value.
-
getAndSet
org.reactivestreams.Publisher<V> getAndSet(V newValue)
Retrieves current element in the holder and replaces it withnewValue
.- Parameters:
newValue
- - value to set- Returns:
- previous value
-
get
org.reactivestreams.Publisher<V> get()
Retrieves element stored in the holder.- Returns:
- element
-
getAndDelete
org.reactivestreams.Publisher<V> getAndDelete()
Retrieves element in the holder and removes it.- Returns:
- element
-
set
org.reactivestreams.Publisher<Void> set(V value)
Stores element into the holder.- Parameters:
value
- - value to set- Returns:
- void
-
-