Package org.redisson.api
Interface RSetCacheAsync<V>
- Type Parameters:
V
- value
- All Superinterfaces:
RCollectionAsync<V>
,RExpirableAsync
,RObjectAsync
- All Known Subinterfaces:
RSetCache<V>
- All Known Implementing Classes:
RedissonSetCache
,RedissonTransactionalSetCache
Async set functions
- Author:
- Nikita Koksharov
-
Method Summary
Modifier and TypeMethodDescriptionStores value with specified time to live.Read all elements at onceReturns the number of elements in cache.tryAddAsync
(long ttl, TimeUnit unit, V... values) Tries to add elements only if none of them in set.tryAddAsync
(V... values) Tries to add elements only if none of them in set.Methods inherited from interface org.redisson.api.RCollectionAsync
addAllAsync, addAsync, containsAllAsync, containsAsync, removeAllAsync, removeAsync, retainAllAsync
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
addListenerAsync, copyAsync, deleteAsync, dumpAsync, getIdleTimeAsync, isExistsAsync, migrateAsync, moveAsync, removeListenerAsync, renameAsync, renamenxAsync, restoreAndReplaceAsync, restoreAndReplaceAsync, restoreAsync, restoreAsync, sizeInMemoryAsync, touchAsync, unlinkAsync
-
Method Details
-
addAsync
Stores value with specified time to live. Value expires after specified time to live.- Parameters:
value
- to addttl
- - time to live for key\value entry. If0
then stores infinitely.unit
- - time unit- Returns:
true
if value has been added.false
if value already been in collection.
-
sizeAsync
Returns the number of elements in cache. This number can reflects expired elements too due to non realtime cleanup process.- Specified by:
sizeAsync
in interfaceRCollectionAsync<V>
- Returns:
- size of set
-
readAllAsync
Read all elements at once- Returns:
- values
-
tryAddAsync
Tries to add elements only if none of them in set.- Parameters:
values
- - values to add- Returns:
true
if elements successfully added, otherwisefalse
.
-
tryAddAsync
Tries to add elements only if none of them in set.- Parameters:
values
- - values to addttl
- - time to live for value. If0
then stores infinitely.unit
- - time unit- Returns:
true
if elements successfully added, otherwisefalse
.
-