Package org.redisson.api
Interface RExpirableRx
-
- All Superinterfaces:
RObjectRx
- All Known Subinterfaces:
RAtomicDoubleRx
,RAtomicLongRx
,RBitSetRx
,RBlockingDequeRx<V>
,RBlockingQueueRx<V>
,RBucketRx<V>
,RCollectionRx<V>
,RDequeRx<V>
,RGeoRx<V>
,RHyperLogLogRx<V>
,RLexSortedSetRx
,RListMultimapRx<K,V>
,RListRx<V>
,RLockRx
,RMapCacheRx<K,V>
,RMapRx<K,V>
,RMultimapRx<K,V>
,RPermitExpirableSemaphoreRx
,RQueueRx<V>
,RScoredSortedSetRx<V>
,RSemaphoreRx
,RSetCacheRx<V>
,RSetMultimapRx<K,V>
,RSetRx<V>
,RStreamRx<K,V>
public interface RExpirableRx extends RObjectRx
Base interface for all Redisson objects which support expiration or TTL- Author:
- Nikita Koksharov
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description io.reactivex.Flowable<Boolean>
clearExpire()
Clear an expire timeout or expire date for object in mode.io.reactivex.Flowable<Boolean>
expire(long timeToLive, TimeUnit timeUnit)
Set a timeout for object in mode.io.reactivex.Flowable<Boolean>
expireAt(long timestamp)
Set an expire date for object in mode.io.reactivex.Flowable<Boolean>
expireAt(Date timestamp)
Set an expire date for object in mode.io.reactivex.Flowable<Long>
remainTimeToLive()
Get remaining time to live of object in milliseconds.
-
-
-
Method Detail
-
expire
io.reactivex.Flowable<Boolean> expire(long timeToLive, TimeUnit timeUnit)
Set a timeout for object in mode. After the timeout has expired, the key will automatically be deleted.- Parameters:
timeToLive
- - timeout before object will be deletedtimeUnit
- - timeout time unit- Returns:
true
if the timeout was set andfalse
if not
-
expireAt
io.reactivex.Flowable<Boolean> expireAt(Date timestamp)
Set an expire date for object in mode. When expire date comes the key will automatically be deleted.- Parameters:
timestamp
- - expire date- Returns:
true
if the timeout was set andfalse
if not
-
expireAt
io.reactivex.Flowable<Boolean> expireAt(long timestamp)
Set an expire date for object in mode. When expire date comes the key will automatically be deleted.- Parameters:
timestamp
- - expire date in milliseconds (Unix timestamp)- Returns:
true
if the timeout was set andfalse
if not
-
clearExpire
io.reactivex.Flowable<Boolean> clearExpire()
Clear an expire timeout or expire date for object in mode. Object will not be deleted.- Returns:
true
if the timeout was cleared andfalse
if not
-
remainTimeToLive
io.reactivex.Flowable<Long> remainTimeToLive()
Get remaining time to live of object in milliseconds.- Returns:
- time in milliseconds -2 if the key does not exist. -1 if the key exists but has no associated expire.
-
-