Package org.redisson.api
Interface RBucketAsync<V>
- Type Parameters:
V
- - the type of object
- All Superinterfaces:
RExpirableAsync
,RObjectAsync
- All Known Subinterfaces:
RBinaryStream
,RBucket<V>
,RJsonBucket<V>
,RJsonBucketAsync<V>
- All Known Implementing Classes:
ExpireAtOperation.RedissonBucketExtended
,ExpireOperation.RedissonBucketExtended
,RedissonBinaryStream
,RedissonBucket
,RedissonJsonBucket
,RedissonTransactionalBucket
Async implementation of object holder. Max size of object is 512MB
- Author:
- Nikita Koksharov
-
Method Summary
Modifier and TypeMethodDescriptionaddListenerAsync
(ObjectListener listener) Adds object event listenercompareAndSetAsync
(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.Retrieves current element in the holder and clears expiration date set before.Retrieves element in the holder and removes it.getAndExpireAsync
(Duration duration) Retrieves current element in the holder and sets an expiration duration for it.getAndExpireAsync
(Instant time) Retrieves current element in the holder and sets an expiration date for it.getAndSetAsync
(V newValue) Retrieves current element in the holder and replaces it withnewValue
.getAndSetAsync
(V value, long timeToLive, TimeUnit timeUnit) UsegetAndSetAsync(Object, Duration)
insteadgetAndSetAsync
(V value, Duration duration) Retrieves current element in the holder and replaces it withvalue
with defined expirationduration
.getAsync()
Retrieves element stored in the holder.setAndKeepTTLAsync
(V value) Set value and keep existing TTL.Stores element into the holder.UsesetAsync(Object, Duration)
insteadStoresvalue
into the holder with defined expirationduration
.setIfAbsentAsync
(V value) Sets value only if object holder doesn't exist.setIfAbsentAsync
(V value, Duration duration) Sets value with defined duration only if object holder doesn't exist.setIfExistsAsync
(V value) Sets value only if it's already exists.setIfExistsAsync
(V value, long timeToLive, TimeUnit timeUnit) UsesetIfExistsAsync(Object, Duration)
insteadsetIfExistsAsync
(V value, Duration duration) Setsvalue
with expirationduration
only if object holder already exists.Returns size of object in bytestrySetAsync
(V value) Deprecated.trySetAsync
(V value, long timeToLive, TimeUnit timeUnit) Deprecated.Methods inherited from interface org.redisson.api.RExpirableAsync
clearExpireAsync, expireAsync, expireAsync, expireAsync, expireAtAsync, expireAtAsync, expireIfGreaterAsync, expireIfGreaterAsync, expireIfLessAsync, expireIfLessAsync, expireIfNotSetAsync, expireIfNotSetAsync, expireIfSetAsync, expireIfSetAsync, getExpireTimeAsync, remainTimeToLiveAsync
Methods inherited from interface org.redisson.api.RObjectAsync
copyAsync, deleteAsync, dumpAsync, getIdleTimeAsync, isExistsAsync, migrateAsync, moveAsync, removeListenerAsync, renameAsync, renamenxAsync, restoreAndReplaceAsync, restoreAndReplaceAsync, restoreAsync, restoreAsync, sizeInMemoryAsync, touchAsync, unlinkAsync
-
Method Details
-
sizeAsync
Returns size of object in bytes- Returns:
- object size
-
getAsync
Retrieves element stored in the holder.- Returns:
- element
-
getAndDeleteAsync
Retrieves element in the holder and removes it.- Returns:
- element
-
trySetAsync
Deprecated.UsesetIfAbsentAsync(Object)
instead- Parameters:
value
- - value to set- Returns:
true
if successful, orfalse
if element was already set
-
trySetAsync
Deprecated.UsesetIfAbsentAsync(Object, Duration)
instead- 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
-
setIfAbsentAsync
Sets value only if object holder doesn't exist.- Parameters:
value
- - value to set- Returns:
true
if successful, orfalse
if element was already set
-
setIfAbsentAsync
Sets value with defined duration only if object holder doesn't exist.- Parameters:
value
- value to setduration
- expiration duration- Returns:
true
if successful, orfalse
if element was already set
-
setIfExistsAsync
Sets value only if it's already exists.- Parameters:
value
- - value to set- Returns:
true
if successful, orfalse
if element wasn't set
-
setIfExistsAsync
UsesetIfExistsAsync(Object, Duration)
instead- Parameters:
value
- - value to settimeToLive
- - time to live intervaltimeUnit
- - unit of time to live interval- Returns:
true
if successful, orfalse
if element wasn't set
-
setIfExistsAsync
Setsvalue
with expirationduration
only if object holder already exists.- Parameters:
value
- value to setduration
- expiration duration- Returns:
true
if successful, orfalse
if element wasn't set
-
compareAndSetAsync
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.
-
getAndSetAsync
Retrieves current element in the holder and replaces it withnewValue
.- Parameters:
newValue
- - value to set- Returns:
- previous value
-
getAndSetAsync
UsegetAndSetAsync(Object, Duration)
instead- Parameters:
value
- - value to settimeToLive
- - time to live intervaltimeUnit
- - unit of time to live interval- Returns:
- previous value
-
getAndSetAsync
Retrieves current element in the holder and replaces it withvalue
with defined expirationduration
.- Parameters:
value
- value to setduration
- expiration duration- Returns:
- previous value
-
getAndExpireAsync
Retrieves current element in the holder and sets an expiration duration for it.Requires Redis 6.2.0 and higher.
- Parameters:
duration
- of object time to live interval- Returns:
- element
-
getAndExpireAsync
Retrieves current element in the holder and sets an expiration date for it.Requires Redis 6.2.0 and higher.
- Parameters:
time
- of exact object expiration moment- Returns:
- element
-
getAndClearExpireAsync
Retrieves current element in the holder and clears expiration date set before.Requires Redis 6.2.0 and higher.
- Returns:
- element
-
setAsync
Stores element into the holder.- Parameters:
value
- - value to set- Returns:
- void
-
setAsync
UsesetAsync(Object, Duration)
instead- Parameters:
value
- - value to settimeToLive
- - time to live intervaltimeUnit
- - unit of time to live interval- Returns:
- void
-
setAsync
Storesvalue
into the holder with defined expirationduration
.- Parameters:
value
- value to setduration
- expiration duration
-
setAndKeepTTLAsync
Set value and keep existing TTL.Requires Redis 6.0.0 and higher.
- Parameters:
value
- - value to set- Returns:
- void
-
addListenerAsync
Adds object event listener- Specified by:
addListenerAsync
in interfaceRObjectAsync
- Parameters:
listener
- - object event listener- Returns:
- listener id
- See Also:
-