-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
Labels
status: declinedA suggestion or change that we dont feel we should currently applyA suggestion or change that we dont feel we should currently apply
Description
Feature Request
Redis Server has a "timeout" conf, when a connection idle "timeout" seconds, Redis Server will close the connection.
Why lettuce not support a connection heartbeat, such as:
ClientResources resources = ClientResources.builder()
.nettyCustomizer(new NettyCustomizer() {
@Override
public void afterChannelInitialized(Channel channel) {
channel.pipeline().addLast(new IdleStateHandler(0, 3, 0, TimeUnit.SECONDS));
channel.pipeline().addLast(new ChannelDuplexHandler() {
@Override
public void userEventTriggered(ChannelHandlerContext ctx, Object evt) throws Exception {
if (evt instanceof IdleStateEvent) {
Command<String, String, String> command = new Command<>(CommandType.PING, new StatusOutput<>(StringCodec.UTF8), null);
if (ctx.channel().isActive()) {
ctx.writeAndFlush(command);
}
}
}
});
}
}).build();Metadata
Metadata
Assignees
Labels
status: declinedA suggestion or change that we dont feel we should currently applyA suggestion or change that we dont feel we should currently apply