Package org.redisson.api
Interface RExpirableRx
-
- All Superinterfaces:
RObjectRx
- All Known Subinterfaces:
RAtomicDoubleRx,RAtomicLongRx,RBinaryStreamRx,RBitSetRx,RBlockingDequeRx<V>,RBlockingQueueRx<V>,RBucketRx<V>,RCollectionRx<V>,RDequeRx<V>,RGeoRx<V>,RHyperLogLogRx<V>,RIdGeneratorRx,RLexSortedSetRx,RListMultimapCacheRx<K,V>,RListMultimapRx<K,V>,RListRx<V>,RMapCacheRx<K,V>,RMapRx<K,V>,RMultimapRx<K,V>,RPermitExpirableSemaphoreRx,RQueueRx<V>,RRateLimiterRx,RReliableTopicRx,RRingBufferRx<V>,RScoredSortedSetRx<V>,RSemaphoreRx,RSetCacheRx<V>,RSetMultimapCacheRx<K,V>,RSetMultimapRx<K,V>,RSetRx<V>,RStreamRx<K,V>,RTimeSeriesRx<V>,RTransferQueueRx<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 Deprecated Methods Modifier and Type Method Description io.reactivex.rxjava3.core.Single<Boolean>clearExpire()Clear an expire timeout or expire date for object in mode.io.reactivex.rxjava3.core.Single<Boolean>expire(long timeToLive, TimeUnit timeUnit)Set a timeout for object in mode.io.reactivex.rxjava3.core.Single<Boolean>expireAt(long timestamp)Deprecated.io.reactivex.rxjava3.core.Single<Boolean>expireAt(Instant instant)Set an expire date for object.io.reactivex.rxjava3.core.Single<Boolean>expireAt(Date timestamp)Deprecated.io.reactivex.rxjava3.core.Single<Long>remainTimeToLive()Get remaining time to live of object in milliseconds.-
Methods inherited from interface org.redisson.api.RObjectRx
addListener, copy, delete, dump, getCodec, getIdleTime, getName, isExists, migrate, move, removeListener, rename, renamenx, restore, restore, restoreAndReplace, restoreAndReplace, sizeInMemory, touch, unlink
-
-
-
-
Method Detail
-
expire
io.reactivex.rxjava3.core.Single<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:
trueif the timeout was set andfalseif not
-
expireAt
@Deprecated io.reactivex.rxjava3.core.Single<Boolean> expireAt(Date timestamp)
Deprecated.UseexpireAt(Instant)instead- Parameters:
timestamp- - expire date- Returns:
trueif the timeout was set andfalseif not
-
expireAt
@Deprecated io.reactivex.rxjava3.core.Single<Boolean> expireAt(long timestamp)
Deprecated.UseexpireAt(Instant)instead- Parameters:
timestamp- - expire date in milliseconds (Unix timestamp)- Returns:
trueif the timeout was set andfalseif not
-
expireAt
io.reactivex.rxjava3.core.Single<Boolean> expireAt(Instant instant)
Set an expire date for object. When expire date comes the key will automatically be deleted.- Parameters:
instant- - expire date- Returns:
trueif the timeout was set andfalseif not
-
clearExpire
io.reactivex.rxjava3.core.Single<Boolean> clearExpire()
Clear an expire timeout or expire date for object in mode. Object will not be deleted.- Returns:
trueif the timeout was cleared andfalseif not
-
remainTimeToLive
io.reactivex.rxjava3.core.Single<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.
-
-