cicada
cicada copied to clipboard
Is it better to use ChannelFutureListener at the end of HttpDispatcher
Hi, in your code HttpDispatcher:105, is it better to put the cleaning code to the ChannelFutureListener of ctx.writeAndFlush(response);
?
future = ctx.writeAndFlush(response);
if (future.isSuccess()) {
CicadaContext.removeContext();
}
do you mean this?
ctx.writeAndFlush(response).addListeners(new Cleaner());
Cleaner
will implement ChannelFutureListener