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

feat(web): allow to shutdown faster when there is no more requests on h1 #1193

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

joelwurtz
Copy link
Contributor

@joelwurtz joelwurtz commented Jan 30, 2025

Ref #1190

Still a draft but this is an example on how we could shutdown faster and cleanly even when there is still pending connections, this is a proof of concept on h1 dispatcher, h2 and h3 can do something similar also

I used a tokio::sync::watch channel tokio_util::CancellationToken to check for shutdown change but maybe there is a better solution (there is a lot of things to adapt, like naming, correct deps, etc ... but this is mainly an example for the moment)

@joelwurtz joelwurtz force-pushed the feat/shutdown-when-no-requests branch from 52ce564 to 27dfc69 Compare January 30, 2025 17:00
@@ -34,7 +34,7 @@ async fn h1_get() -> Result<(), Error> {
assert_eq!("GET Response", body);
}

handle.try_handle()?.stop(false);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

before this change this would wait for the keep alive timeout, now it shut down instantly (because there is no pending request)

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

Successfully merging this pull request may close these issues.

1 participant