Feature - remainTimeToLive method added to RLock, RLockAsync, RLockRx and RLockReactive interfaces. #2011

pull/2041/head
Nikita Koksharov 6 years ago
parent bbe40d02ef
commit d75f610233

@ -547,4 +547,14 @@ public class RedissonMultiLock implements RLock {
throw new UnsupportedOperationException(); throw new UnsupportedOperationException();
} }
@Override
public RFuture<Long> remainTimeToLiveAsync() {
throw new UnsupportedOperationException();
}
@Override
public long remainTimeToLive() {
throw new UnsupportedOperationException();
}
} }

@ -129,4 +129,13 @@ public interface RLock extends Lock, RLockAsync {
*/ */
int getHoldCount(); int getHoldCount();
/**
* Remaining time to live of this lock
*
* @return time in milliseconds
* -2 if the lock does not exist.
* -1 if the lock exists but has no associated expire.
*/
long remainTimeToLive();
} }

@ -166,4 +166,13 @@ public interface RLockAsync {
*/ */
RFuture<Boolean> isLockedAsync(); RFuture<Boolean> isLockedAsync();
/**
* Remaining time to live of this lock
*
* @return time in milliseconds
* -2 if the lock does not exist.
* -1 if the lock exists but has no associated expire.
*/
RFuture<Long> remainTimeToLiveAsync();
} }

@ -175,4 +175,13 @@ public interface RLockReactive {
*/ */
Mono<Boolean> isLocked(); Mono<Boolean> isLocked();
/**
* Remaining time to live of this lock
*
* @return time in milliseconds
* -2 if the lock does not exist.
* -1 if the lock exists but has no associated expire.
*/
Mono<Long> remainTimeToLive();
} }

@ -176,4 +176,13 @@ public interface RLockRx {
*/ */
Single<Boolean> isLocked(); Single<Boolean> isLocked();
/**
* Remaining time to live of this lock
*
* @return time in milliseconds
* -2 if the lock does not exist.
* -1 if the lock exists but has no associated expire.
*/
Single<Long> remainTimeToLive();
} }

Loading…
Cancel
Save