Class RedissonPermitExpirableSemaphore
- java.lang.Object
-
- org.redisson.RedissonObject
-
- org.redisson.RedissonPermitExpirableSemaphore
-
- All Implemented Interfaces:
RExpirable
,RExpirableAsync
,RObject
,RObjectAsync
,RPermitExpirableSemaphore
,RPermitExpirableSemaphoreAsync
public class RedissonPermitExpirableSemaphore extends RedissonObject implements RPermitExpirableSemaphore
- Author:
- Nikita Koksharov
-
-
Field Summary
-
Fields inherited from class org.redisson.RedissonObject
codec
-
-
Constructor Summary
Constructors Constructor Description RedissonPermitExpirableSemaphore(CommandAsyncExecutor commandExecutor, String name, SemaphorePubSub semaphorePubSub)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description String
acquire()
Acquires a permit from this semaphore, blocking until one is available, or the thread is interrupted.String
acquire(long leaseTime, TimeUnit timeUnit)
Acquires a permit with defined lease time from this semaphore, blocking until one is available, or the thread is interrupted.RFuture<String>
acquireAsync()
Acquires a permit from this semaphore, blocking until one is available, or the thread is interrupted.RFuture<String>
acquireAsync(long leaseTime, TimeUnit timeUnit)
Acquires a permit with defined lease time from this semaphore, blocking until one is available, or the thread is interrupted.void
addPermits(int permits)
Increases or decreases the number of available permits by defined value.RFuture<Void>
addPermitsAsync(int permits)
Increases or decreases the number of available permits by defined value.int
availablePermits()
Returns the current number of available permits.RFuture<Integer>
availablePermitsAsync()
Returns the current number of available permits.boolean
clearExpire()
Clear an expire timeout or expire date for object.RFuture<Boolean>
clearExpireAsync()
Clear an expire timeout or expire date for object in async mode.RFuture<Boolean>
deleteAsync()
Delete object in async modeboolean
expire(long timeToLive, TimeUnit timeUnit)
Set a timeout for object.RFuture<Boolean>
expireAsync(long timeToLive, TimeUnit timeUnit)
Set a timeout for object in async mode.boolean
expireAt(long timestamp)
Set an expire date for object.boolean
expireAt(Date timestamp)
Set an expire date for object.RFuture<Boolean>
expireAtAsync(long timestamp)
Set an expire date for object in async mode.RFuture<Boolean>
expireAtAsync(Date timestamp)
Set an expire date for object in async mode.protected String
generateId()
static String
getChannelName(String name)
void
release(String permitId)
Releases a permit by its id, returning it to the semaphore.RFuture<Void>
releaseAsync(String permitId)
Releases a permit by its id, returning it to the semaphore.long
remainTimeToLive()
Remaining time to live of Redisson object that has a timeoutRFuture<Long>
remainTimeToLiveAsync()
Remaining time to live of Redisson object that has a timeoutRFuture<Long>
sizeInMemoryAsync()
Returns size of object in Redis memoryString
tryAcquire()
Acquires a permit only if one is available at the time of invocation.String
tryAcquire(long waitTime, long ttl, TimeUnit unit)
Acquires a permit with defined lease time from this semaphore, if one becomes available within the given waiting time and the current thread has not been interrupted.String
tryAcquire(long waitTime, TimeUnit unit)
Acquires a permit from this semaphore, if one becomes available within the given waiting time and the current thread has not been interrupted.RFuture<String>
tryAcquireAsync()
Acquires a permit only if one is available at the time of invocation.RFuture<String>
tryAcquireAsync(int permits, long timeoutDate)
RFuture<String>
tryAcquireAsync(long waitTime, long ttl, TimeUnit unit)
Acquires a permit with defined lease time from this semaphore, if one becomes available within the given waiting time and the current thread has not been interrupted.RFuture<String>
tryAcquireAsync(long waitTime, TimeUnit unit)
Acquires a permit from this semaphore, if one becomes available within the given waiting time and the current thread has not been interrupted.boolean
tryRelease(String permitId)
Releases a permit by its id, returning it to the semaphore.RFuture<Boolean>
tryReleaseAsync(String permitId)
Releases a permit by its id, returning it to the semaphore.boolean
trySetPermits(int permits)
Sets number of permits.RFuture<Boolean>
trySetPermitsAsync(int permits)
Sets number of permits.boolean
updateLeaseTime(String permitId, long leaseTime, TimeUnit unit)
Overrides and updates lease time for defined permit id.RFuture<Boolean>
updateLeaseTimeAsync(String permitId, long leaseTime, TimeUnit unit)
Overrides and updates lease time for defined permit id.-
Methods inherited from class org.redisson.RedissonObject
await, copy, copyAsync, delete, dump, dumpAsync, encode, encode, encode, encodeMapKey, encodeMapKeys, encodeMapValue, encodeMapValues, get, getCodec, getName, getName, isExists, isExistsAsync, migrate, migrateAsync, move, moveAsync, prefixName, rename, renameAsync, renamenx, renamenxAsync, restore, restore, restoreAndReplace, restoreAndReplace, restoreAndReplaceAsync, restoreAndReplaceAsync, restoreAsync, restoreAsync, sizeInMemory, sizeInMemoryAsync, suffixName, toSeconds, touch, touchAsync, unlink, unlinkAsync
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.redisson.api.RExpirable
clearExpire, expire, expireAt, expireAt, remainTimeToLive
-
Methods inherited from interface org.redisson.api.RExpirableAsync
expireAtAsync, remainTimeToLiveAsync
-
Methods inherited from interface org.redisson.api.RObject
copy, delete, dump, getCodec, getName, isExists, migrate, move, rename, renamenx, restore, restore, restoreAndReplace, restoreAndReplace, sizeInMemory, touch, unlink
-
Methods inherited from interface org.redisson.api.RObjectAsync
copyAsync, dumpAsync, isExistsAsync, migrateAsync, moveAsync, renameAsync, renamenxAsync, restoreAndReplaceAsync, restoreAndReplaceAsync, restoreAsync, restoreAsync, touchAsync, unlinkAsync
-
-
-
-
Constructor Detail
-
RedissonPermitExpirableSemaphore
public RedissonPermitExpirableSemaphore(CommandAsyncExecutor commandExecutor, String name, SemaphorePubSub semaphorePubSub)
-
-
Method Detail
-
acquire
public String acquire() throws InterruptedException
Description copied from interface:RPermitExpirableSemaphore
Acquires a permit from this semaphore, blocking until one is available, or the thread is interrupted.Acquires a permit, if one is available and returns its id, reducing the number of available permits by one.
If no permit is available then the current thread becomes disabled for thread scheduling purposes and lies dormant until one of two things happens:
- Some other thread invokes the
RPermitExpirableSemaphore.release(java.lang.String)
method for this semaphore and the current thread is next to be assigned a permit; or - Some other thread interrupts the current thread.
- Specified by:
acquire
in interfaceRPermitExpirableSemaphore
- Returns:
- permit id
- Throws:
InterruptedException
- if the current thread is interrupted
- Some other thread invokes the
-
acquire
public String acquire(long leaseTime, TimeUnit timeUnit) throws InterruptedException
Description copied from interface:RPermitExpirableSemaphore
Acquires a permit with defined lease time from this semaphore, blocking until one is available, or the thread is interrupted.Acquires a permit, if one is available and returns its id, reducing the number of available permits by one.
If no permit is available then the current thread becomes disabled for thread scheduling purposes and lies dormant until one of two things happens:
- Some other thread invokes the
RPermitExpirableSemaphore.release(java.lang.String)
method for this semaphore and the current thread is next to be assigned a permit; or - Some other thread interrupts the current thread.
- Specified by:
acquire
in interfaceRPermitExpirableSemaphore
- Parameters:
leaseTime
- - permit lease timetimeUnit
- - time unit- Returns:
- permit id
- Throws:
InterruptedException
- if the current thread is interrupted
- Some other thread invokes the
-
acquireAsync
public RFuture<String> acquireAsync(long leaseTime, TimeUnit timeUnit)
Description copied from interface:RPermitExpirableSemaphoreAsync
Acquires a permit with defined lease time from this semaphore, blocking until one is available, or the thread is interrupted.Acquires a permit, if one is available and returns its id, reducing the number of available permits by one.
If no permit is available then the current thread becomes disabled for thread scheduling purposes and lies dormant until one of two things happens:
- Some other thread invokes the
RPermitExpirableSemaphoreAsync.releaseAsync(java.lang.String)
method for this semaphore and the current thread is next to be assigned a permit; or - Some other thread interrupts the current thread.
- Specified by:
acquireAsync
in interfaceRPermitExpirableSemaphoreAsync
- Parameters:
leaseTime
- - permit lease timetimeUnit
- - time unit- Returns:
- permit id
- Some other thread invokes the
-
acquireAsync
public RFuture<String> acquireAsync()
Description copied from interface:RPermitExpirableSemaphoreAsync
Acquires a permit from this semaphore, blocking until one is available, or the thread is interrupted.Acquires a permit, if one is available and returns its id, reducing the number of available permits by one.
If no permit is available then the current thread becomes disabled for thread scheduling purposes and lies dormant until one of two things happens:
- Some other thread invokes the
RPermitExpirableSemaphoreAsync.releaseAsync(String)
method for this semaphore and the current thread is next to be assigned a permit; or - Some other thread interrupts the current thread.
- Specified by:
acquireAsync
in interfaceRPermitExpirableSemaphoreAsync
- Returns:
- permit id
- Some other thread invokes the
-
tryAcquire
public String tryAcquire()
Description copied from interface:RPermitExpirableSemaphore
Acquires a permit only if one is available at the time of invocation.Acquires a permit, if one is available and returns immediately, with the permit id, reducing the number of available permits by one.
If no permit is available then this method will return immediately with the value
null
.- Specified by:
tryAcquire
in interfaceRPermitExpirableSemaphore
- Returns:
- permit id if a permit was acquired and
null
otherwise
-
tryAcquireAsync
public RFuture<String> tryAcquireAsync()
Description copied from interface:RPermitExpirableSemaphoreAsync
Acquires a permit only if one is available at the time of invocation.Acquires a permit, if one is available and returns immediately, with the permit id, reducing the number of available permits by one.
If no permit is available then this method will return immediately with the value
null
.- Specified by:
tryAcquireAsync
in interfaceRPermitExpirableSemaphoreAsync
- Returns:
- permit id if a permit was acquired and
null
otherwise
-
generateId
protected String generateId()
-
tryAcquireAsync
public RFuture<String> tryAcquireAsync(long waitTime, TimeUnit unit)
Description copied from interface:RPermitExpirableSemaphoreAsync
Acquires a permit from this semaphore, if one becomes available within the given waiting time and the current thread has not been interrupted.Acquires a permit, if one is available and returns immediately, with the permit id, reducing the number of available permits by one.
If no permit is available then the current thread becomes disabled for thread scheduling purposes and lies dormant until one of three things happens:
- Some other thread invokes the
RPermitExpirableSemaphoreAsync.releaseAsync(String)
method for this semaphore and the current thread is next to be assigned a permit; or - Some other thread interrupts the current thread; or
- The specified waiting time elapses.
If a permit is acquired then the permit id is returned.
If the specified waiting time elapses then the value
null
is returned. If the time is less than or equal to zero, the method will not wait at all.- Specified by:
tryAcquireAsync
in interfaceRPermitExpirableSemaphoreAsync
- Parameters:
waitTime
- the maximum time to wait for a permitunit
- the time unit of thetimeout
argument- Returns:
- permit id if a permit was acquired and
null
if the waiting time elapsed before a permit was acquired
- Some other thread invokes the
-
tryAcquire
public String tryAcquire(long waitTime, long ttl, TimeUnit unit) throws InterruptedException
Description copied from interface:RPermitExpirableSemaphore
Acquires a permit with defined lease time from this semaphore, if one becomes available within the given waiting time and the current thread has not been interrupted.Acquires a permit, if one is available and returns immediately, with the permit id, reducing the number of available permits by one.
If no permit is available then the current thread becomes disabled for thread scheduling purposes and lies dormant until one of three things happens:
- Some other thread invokes the
RPermitExpirableSemaphore.release(java.lang.String)
method for this semaphore and the current thread is next to be assigned a permit; or - Some other thread interrupts the current thread; or
- The specified waiting time elapses.
If a permit is acquired then the permit id is returned.
If the specified waiting time elapses then the value
null
is returned. If the time is less than or equal to zero, the method will not wait at all.- Specified by:
tryAcquire
in interfaceRPermitExpirableSemaphore
- Parameters:
waitTime
- the maximum time to wait for a permitttl
- permit lease time, use -1 to make it permanentunit
- the time unit of thetimeout
argument- Returns:
- permit id if a permit was acquired and
null
if the waiting time elapsed before a permit was acquired - Throws:
InterruptedException
- if the current thread is interrupted
- Some other thread invokes the
-
tryAcquireAsync
public RFuture<String> tryAcquireAsync(long waitTime, long ttl, TimeUnit unit)
Description copied from interface:RPermitExpirableSemaphoreAsync
Acquires a permit with defined lease time from this semaphore, if one becomes available within the given waiting time and the current thread has not been interrupted.Acquires a permit, if one is available and returns immediately, with the permit id, reducing the number of available permits by one.
If no permit is available then the current thread becomes disabled for thread scheduling purposes and lies dormant until one of three things happens:
- Some other thread invokes the
RPermitExpirableSemaphoreAsync.releaseAsync(String)
method for this semaphore and the current thread is next to be assigned a permit; or - Some other thread interrupts the current thread; or
- The specified waiting time elapses.
If a permit is acquired then the permit id is returned.
If the specified waiting time elapses then the value
null
is returned. If the time is less than or equal to zero, the method will not wait at all.- Specified by:
tryAcquireAsync
in interfaceRPermitExpirableSemaphoreAsync
- Parameters:
waitTime
- the maximum time to wait for a permitttl
- permit lease time, use -1 to make it permanentunit
- the time unit of thetimeout
argument- Returns:
- permit id if a permit was acquired and
null
if the waiting time elapsed before a permit was acquired
- Some other thread invokes the
-
tryAcquire
public String tryAcquire(long waitTime, TimeUnit unit) throws InterruptedException
Description copied from interface:RPermitExpirableSemaphore
Acquires a permit from this semaphore, if one becomes available within the given waiting time and the current thread has not been interrupted.Acquires a permit, if one is available and returns immediately, with the permit id, reducing the number of available permits by one.
If no permit is available then the current thread becomes disabled for thread scheduling purposes and lies dormant until one of three things happens:
- Some other thread invokes the
RPermitExpirableSemaphore.release(java.lang.String)
method for this semaphore and the current thread is next to be assigned a permit; or - Some other thread interrupts the current thread; or
- The specified waiting time elapses.
If a permit is acquired then the permit id is returned.
If the specified waiting time elapses then the value
null
is returned. If the time is less than or equal to zero, the method will not wait at all.- Specified by:
tryAcquire
in interfaceRPermitExpirableSemaphore
- Parameters:
waitTime
- the maximum time to wait for a permitunit
- the time unit of thetimeout
argument- Returns:
- permit id if a permit was acquired and
null
if the waiting time elapsed before a permit was acquired - Throws:
InterruptedException
- if the current thread is interrupted
- Some other thread invokes the
-
release
public void release(String permitId)
Description copied from interface:RPermitExpirableSemaphore
Releases a permit by its id, returning it to the semaphore.Releases a permit, increasing the number of available permits by one. If any threads of Redisson client are trying to acquire a permit, then one is selected and given the permit that was just released.
There is no requirement that a thread that releases a permit must have acquired that permit by calling
RPermitExpirableSemaphore.acquire()
. Correct usage of a semaphore is established by programming convention in the application.Throws an exception if permit id doesn't exist or has already been release
- Specified by:
release
in interfaceRPermitExpirableSemaphore
- Parameters:
permitId
- - permit id
-
tryRelease
public boolean tryRelease(String permitId)
Description copied from interface:RPermitExpirableSemaphore
Releases a permit by its id, returning it to the semaphore.Releases a permit, increasing the number of available permits by one. If any threads of Redisson client are trying to acquire a permit, then one is selected and given the permit that was just released.
There is no requirement that a thread that releases a permit must have acquired that permit by calling
RPermitExpirableSemaphore.acquire()
. Correct usage of a semaphore is established by programming convention in the application.- Specified by:
tryRelease
in interfaceRPermitExpirableSemaphore
- Parameters:
permitId
- - permit id- Returns:
true
if a permit has been released andfalse
otherwise
-
tryReleaseAsync
public RFuture<Boolean> tryReleaseAsync(String permitId)
Description copied from interface:RPermitExpirableSemaphoreAsync
Releases a permit by its id, returning it to the semaphore.Releases a permit, increasing the number of available permits by one. If any threads of Redisson client are trying to acquire a permit, then one is selected and given the permit that was just released.
There is no requirement that a thread that releases a permit must have acquired that permit by calling
RPermitExpirableSemaphoreAsync.acquireAsync()
. Correct usage of a semaphore is established by programming convention in the application.- Specified by:
tryReleaseAsync
in interfaceRPermitExpirableSemaphoreAsync
- Parameters:
permitId
- - permit id- Returns:
true
if a permit has been released andfalse
otherwise
-
sizeInMemoryAsync
public RFuture<Long> sizeInMemoryAsync()
Description copied from interface:RObjectAsync
Returns size of object in Redis memory- Specified by:
sizeInMemoryAsync
in interfaceRObjectAsync
- Overrides:
sizeInMemoryAsync
in classRedissonObject
- Returns:
- size of object
-
deleteAsync
public RFuture<Boolean> deleteAsync()
Description copied from interface:RObjectAsync
Delete object in async mode- Specified by:
deleteAsync
in interfaceRObjectAsync
- Overrides:
deleteAsync
in classRedissonObject
- Returns:
true
if object was deletedfalse
if not
-
expireAsync
public RFuture<Boolean> expireAsync(long timeToLive, TimeUnit timeUnit)
Description copied from interface:RExpirableAsync
Set a timeout for object in async mode. After the timeout has expired, the key will automatically be deleted.- Specified by:
expireAsync
in interfaceRExpirableAsync
- Parameters:
timeToLive
- - timeout before object will be deletedtimeUnit
- - timeout time unit- Returns:
true
if the timeout was set andfalse
if not
-
expireAtAsync
public RFuture<Boolean> expireAtAsync(long timestamp)
Description copied from interface:RExpirableAsync
Set an expire date for object in async mode. When expire date comes the key will automatically be deleted.- Specified by:
expireAtAsync
in interfaceRExpirableAsync
- Parameters:
timestamp
- - expire date in milliseconds (Unix timestamp)- Returns:
true
if the timeout was set andfalse
if not
-
clearExpireAsync
public RFuture<Boolean> clearExpireAsync()
Description copied from interface:RExpirableAsync
Clear an expire timeout or expire date for object in async mode. Object will not be deleted.- Specified by:
clearExpireAsync
in interfaceRExpirableAsync
- Returns:
true
if the timeout was cleared andfalse
if not
-
releaseAsync
public RFuture<Void> releaseAsync(String permitId)
Description copied from interface:RPermitExpirableSemaphoreAsync
Releases a permit by its id, returning it to the semaphore.Releases a permit, increasing the number of available permits by one. If any threads of Redisson client are trying to acquire a permit, then one is selected and given the permit that was just released.
There is no requirement that a thread that releases a permit must have acquired that permit by calling
RPermitExpirableSemaphoreAsync.acquireAsync()
. Correct usage of a semaphore is established by programming convention in the application.Throws an exception if permit id doesn't exist or has already been release
- Specified by:
releaseAsync
in interfaceRPermitExpirableSemaphoreAsync
- Parameters:
permitId
- - permit id- Returns:
- void
-
availablePermits
public int availablePermits()
Description copied from interface:RPermitExpirableSemaphore
Returns the current number of available permits.- Specified by:
availablePermits
in interfaceRPermitExpirableSemaphore
- Returns:
- number of available permits
-
availablePermitsAsync
public RFuture<Integer> availablePermitsAsync()
Description copied from interface:RPermitExpirableSemaphoreAsync
Returns the current number of available permits.- Specified by:
availablePermitsAsync
in interfaceRPermitExpirableSemaphoreAsync
- Returns:
- number of available permits
-
trySetPermits
public boolean trySetPermits(int permits)
Description copied from interface:RPermitExpirableSemaphore
Sets number of permits.- Specified by:
trySetPermits
in interfaceRPermitExpirableSemaphore
- Parameters:
permits
- - number of permits- Returns:
true
if permits has been set successfully, otherwisefalse
.
-
trySetPermitsAsync
public RFuture<Boolean> trySetPermitsAsync(int permits)
Description copied from interface:RPermitExpirableSemaphoreAsync
Sets number of permits.- Specified by:
trySetPermitsAsync
in interfaceRPermitExpirableSemaphoreAsync
- Parameters:
permits
- - number of permits- Returns:
true
if permits has been set successfully, otherwisefalse
.
-
addPermits
public void addPermits(int permits)
Description copied from interface:RPermitExpirableSemaphore
Increases or decreases the number of available permits by defined value.- Specified by:
addPermits
in interfaceRPermitExpirableSemaphore
- Parameters:
permits
- - number of permits to add/remove
-
addPermitsAsync
public RFuture<Void> addPermitsAsync(int permits)
Description copied from interface:RPermitExpirableSemaphoreAsync
Increases or decreases the number of available permits by defined value.- Specified by:
addPermitsAsync
in interfaceRPermitExpirableSemaphoreAsync
- Parameters:
permits
- - number of permits to add/remove- Returns:
- void
-
updateLeaseTimeAsync
public RFuture<Boolean> updateLeaseTimeAsync(String permitId, long leaseTime, TimeUnit unit)
Description copied from interface:RPermitExpirableSemaphoreAsync
Overrides and updates lease time for defined permit id.- Specified by:
updateLeaseTimeAsync
in interfaceRPermitExpirableSemaphoreAsync
- Parameters:
permitId
- - permit idleaseTime
- - permit lease time, use -1 to make it permanentunit
- - the time unit of thetimeout
argument- Returns:
true
if permits has been updated successfully, otherwisefalse
.
-
updateLeaseTime
public boolean updateLeaseTime(String permitId, long leaseTime, TimeUnit unit)
Description copied from interface:RPermitExpirableSemaphore
Overrides and updates lease time for defined permit id.- Specified by:
updateLeaseTime
in interfaceRPermitExpirableSemaphore
- Parameters:
permitId
- - permit idleaseTime
- - permit lease time, use -1 to make it permanentunit
- - the time unit of thetimeout
argument- Returns:
true
if permits has been updated successfully, otherwisefalse
.
-
expire
public boolean expire(long timeToLive, TimeUnit timeUnit)
Description copied from interface:RExpirable
Set a timeout for object. After the timeout has expired, the key will automatically be deleted.- Specified by:
expire
in interfaceRExpirable
- Parameters:
timeToLive
- - timeout before object will be deletedtimeUnit
- - timeout time unit- Returns:
true
if the timeout was set andfalse
if not
-
expireAt
public boolean expireAt(long timestamp)
Description copied from interface:RExpirable
Set an expire date for object. When expire date comes the key will automatically be deleted.- Specified by:
expireAt
in interfaceRExpirable
- Parameters:
timestamp
- - expire date in milliseconds (Unix timestamp)- Returns:
true
if the timeout was set andfalse
if not
-
expireAt
public boolean expireAt(Date timestamp)
Description copied from interface:RExpirable
Set an expire date for object. When expire date comes the key will automatically be deleted.- Specified by:
expireAt
in interfaceRExpirable
- Parameters:
timestamp
- - expire date- Returns:
true
if the timeout was set andfalse
if not
-
expireAtAsync
public RFuture<Boolean> expireAtAsync(Date timestamp)
Description copied from interface:RExpirableAsync
Set an expire date for object in async mode. When expire date comes the key will automatically be deleted.- Specified by:
expireAtAsync
in interfaceRExpirableAsync
- Parameters:
timestamp
- - expire date- Returns:
true
if the timeout was set andfalse
if not
-
clearExpire
public boolean clearExpire()
Description copied from interface:RExpirable
Clear an expire timeout or expire date for object.- Specified by:
clearExpire
in interfaceRExpirable
- Returns:
true
if timeout was removedfalse
if object does not exist or does not have an associated timeout
-
remainTimeToLive
public long remainTimeToLive()
Description copied from interface:RExpirable
Remaining time to live of Redisson object that has a timeout- Specified by:
remainTimeToLive
in interfaceRExpirable
- Returns:
- time in milliseconds -2 if the key does not exist. -1 if the key exists but has no associated expire.
-
remainTimeToLiveAsync
public RFuture<Long> remainTimeToLiveAsync()
Description copied from interface:RExpirableAsync
Remaining time to live of Redisson object that has a timeout- Specified by:
remainTimeToLiveAsync
in interfaceRExpirableAsync
- Returns:
- time in milliseconds -2 if the key does not exist. -1 if the key exists but has no associated expire.
-
-