|
|
|
@ -18,6 +18,7 @@ package org.redisson;
|
|
|
|
|
import io.netty.util.Timeout;
|
|
|
|
|
import io.netty.util.TimerTask;
|
|
|
|
|
import org.redisson.api.BatchOptions;
|
|
|
|
|
import org.redisson.api.BatchResult;
|
|
|
|
|
import org.redisson.api.RFuture;
|
|
|
|
|
import org.redisson.api.RLock;
|
|
|
|
|
import org.redisson.client.RedisException;
|
|
|
|
@ -345,10 +346,21 @@ public class RedissonLock extends RedissonExpirable implements RLock {
|
|
|
|
|
protected <T> RFuture<T> evalWriteAsync(String key, Codec codec, RedisCommand<T> evalCommandType, String script, List<Object> keys, Object... params) {
|
|
|
|
|
CommandBatchService executorService = createCommandBatchService();
|
|
|
|
|
RFuture<T> result = executorService.evalWriteAsync(key, codec, evalCommandType, script, keys, params);
|
|
|
|
|
if (!(commandExecutor instanceof CommandBatchService)) {
|
|
|
|
|
executorService.executeAsync();
|
|
|
|
|
if (commandExecutor instanceof CommandBatchService) {
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
return result;
|
|
|
|
|
|
|
|
|
|
RPromise<T> r = new RedissonPromise<>();
|
|
|
|
|
RFuture<BatchResult<?>> future = executorService.executeAsync();
|
|
|
|
|
future.onComplete((res, ex) -> {
|
|
|
|
|
if (ex != null) {
|
|
|
|
|
r.tryFailure(ex);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
r.trySuccess(result.getNow());
|
|
|
|
|
});
|
|
|
|
|
return r;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
<T> RFuture<T> tryLockInnerAsync(long waitTime, long leaseTime, TimeUnit unit, long threadId, RedisStrictCommand<T> command) {
|
|
|
|
|