Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it better to use ChannelFutureListener at the end of HttpDispatcher #51

Open
xyg-coder opened this issue Mar 16, 2020 · 2 comments
Open
Labels
question Further information is requested

Comments

@xyg-coder
Copy link

Hi, in your code HttpDispatcher:105, is it better to put the cleaning code to the ChannelFutureListener of ctx.writeAndFlush(response);?

@crossoverJie crossoverJie added the question Further information is requested label Mar 30, 2020
@crossoverJie
Copy link
Member

future = ctx.writeAndFlush(response);
if (future.isSuccess()) {
    CicadaContext.removeContext();
}

do you mean this?

@xyg-coder
Copy link
Author

ctx.writeAndFlush(response).addListeners(new Cleaner());

Cleaner will implement ChannelFutureListener

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants