diff --git a/redisson/src/main/java/org/redisson/RedissonPriorityDeque.java b/redisson/src/main/java/org/redisson/RedissonPriorityDeque.java index eb4f9f9cc..2d64d098e 100644 --- a/redisson/src/main/java/org/redisson/RedissonPriorityDeque.java +++ b/redisson/src/main/java/org/redisson/RedissonPriorityDeque.java @@ -25,11 +25,6 @@ import org.redisson.client.protocol.RedisCommand; import org.redisson.client.protocol.RedisCommands; import org.redisson.client.protocol.decoder.ListFirstObjectDecoder; import org.redisson.command.CommandExecutor; -import org.redisson.misc.RPromise; -import org.redisson.misc.RedissonPromise; - -import io.netty.util.concurrent.Future; -import io.netty.util.concurrent.FutureListener; /** * Distributed and concurrent implementation of {@link java.util.Queue} @@ -142,42 +137,7 @@ public class RedissonPriorityDeque extends RedissonPriorityQueue implement } public RFuture pollLastAsync() { - final long threadId = Thread.currentThread().getId(); - final RPromise result = new RedissonPromise(); - lock.lockAsync(threadId).addListener(new FutureListener() { - @Override - public void operationComplete(Future future) throws Exception { - if (!future.isSuccess()) { - result.tryFailure(future.cause()); - return; - } - - RFuture f = commandExecutor.writeAsync(getName(), codec, RedisCommands.RPOP, getName()); - f.addListener(new FutureListener() { - @Override - public void operationComplete(Future future) throws Exception { - if (!future.isSuccess()) { - result.tryFailure(future.cause()); - return; - } - - final V value = future.getNow(); - lock.unlockAsync(threadId).addListener(new FutureListener() { - @Override - public void operationComplete(Future future) throws Exception { - if (!future.isSuccess()) { - result.tryFailure(future.cause()); - return; - } - - result.trySuccess(value); - } - }); - } - }); - } - }); - return result; + return pollAsync(RedisCommands.RPOP, getName()); } @Override