Skip to content

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
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)

@joelwurtz joelwurtz force-pushed the feat/shutdown-when-no-requests branch from 2f236c9 to 91a691c Compare February 27, 2025 09:00
@joelwurtz joelwurtz changed the title feat(web): allow to shutdown faster when there is no more requests on h1 feat(web): allow to shutdown faster when there is no more requests Feb 27, 2025
@joelwurtz joelwurtz marked this pull request as ready for review February 27, 2025 09:01
@joelwurtz
Copy link
Contributor Author

joelwurtz commented Feb 27, 2025

This implementation works to shutdown faster on h1 / h2 and h3 when there is no more requests, however i'm sure there is a better way to do it

@joelwurtz joelwurtz force-pushed the feat/shutdown-when-no-requests branch from 91a691c to f2d2069 Compare February 27, 2025 09:07
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