Merge branch 'master' into 3.0.0

pull/1821/head
Nikita 6 years ago
commit f2bf29542a

@ -28,6 +28,8 @@ import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelInboundHandlerAdapter; import io.netty.channel.ChannelInboundHandlerAdapter;
import io.netty.util.Timeout; import io.netty.util.Timeout;
import io.netty.util.TimerTask; import io.netty.util.TimerTask;
import io.netty.util.concurrent.Future;
import io.netty.util.concurrent.FutureListener;
/** /**
* *
@ -45,7 +47,15 @@ public class PingConnectionHandler extends ChannelInboundHandlerAdapter {
@Override @Override
public void channelActive(ChannelHandlerContext ctx) throws Exception { public void channelActive(ChannelHandlerContext ctx) throws Exception {
RedisConnection connection = RedisConnection.getFrom(ctx.channel());
connection.getConnectionPromise().addListener(new FutureListener<RedisConnection>() {
@Override
public void operationComplete(Future<RedisConnection> future) throws Exception {
if (future.isSuccess()) {
sendPing(ctx); sendPing(ctx);
}
}
});
ctx.fireChannelActive(); ctx.fireChannelActive();
} }

Loading…
Cancel
Save