refactoring

pull/2348/head
Nikita Koksharov 6 years ago
parent 3dcb6369c7
commit 21158954b9

@ -15,12 +15,8 @@
*/ */
package org.redisson.client.handler; package org.redisson.client.handler;
import java.io.IOException; import io.netty.channel.*;
import java.util.List; import io.netty.util.AttributeKey;
import java.util.Queue;
import java.util.concurrent.ConcurrentLinkedQueue;
import java.util.regex.Pattern;
import org.redisson.client.ChannelName; import org.redisson.client.ChannelName;
import org.redisson.client.WriteRedisConnectionException; import org.redisson.client.WriteRedisConnectionException;
import org.redisson.client.protocol.CommandData; import org.redisson.client.protocol.CommandData;
@ -30,14 +26,11 @@ import org.redisson.misc.LogHelper;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import io.netty.channel.Channel; import java.io.IOException;
import io.netty.channel.ChannelDuplexHandler; import java.util.List;
import io.netty.channel.ChannelFuture; import java.util.Queue;
import io.netty.channel.ChannelFutureListener; import java.util.concurrent.ConcurrentLinkedQueue;
import io.netty.channel.ChannelHandlerContext; import java.util.regex.Pattern;
import io.netty.channel.ChannelPromise;
import io.netty.util.AttributeKey;
import io.netty.util.internal.PlatformDependent;
/** /**
* *
@ -56,12 +49,9 @@ public class CommandsQueue extends ChannelDuplexHandler {
private final Queue<QueueCommandHolder> queue = new ConcurrentLinkedQueue<>(); private final Queue<QueueCommandHolder> queue = new ConcurrentLinkedQueue<>();
private final ChannelFutureListener listener = new ChannelFutureListener() { private final ChannelFutureListener listener = future -> {
@Override if (!future.isSuccess() && future.channel().isActive()) {
public void operationComplete(ChannelFuture future) throws Exception { sendNextCommand(future.channel());
if (!future.isSuccess() && future.channel().isActive()) {
sendNextCommand(future.channel());
}
} }
}; };

Loading…
Cancel
Save