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();
}
@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();
/**
* 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();
/**
* 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();
/**
* 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();
}

@ -175,5 +175,14 @@ public interface RLockRx {
* @return <code>true</code> if locked otherwise <code>false</code>
*/
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