-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Update graceful shutdown example #2355
Conversation
|
||
// Wait for all tasks to complete. | ||
debug!("waiting for {} tasks to finish", close_tx.receiver_count()); | ||
close_tx.closed().await; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, didn't know one could await the closing of all watch channel receivers.
Co-authored-by: Jonas Platte <jplatte+git@posteo.de>
Thanks for fixing the example. But I must say, the absence of a I hope something will be offered soon-ish, as I don't see any prod-worthy system going out without a graceful shutdown, and having to provide all that code I see in the example now, seems wasteful and repetitive (community wise). |
@detro Yeah it leaves a lot to be desired, though I don't think it should deter anyone from updating but that's of course up to you. I encourage you to help contributing to hyper-util. That way everyone benefits! The issue regarding graceful shutdown is here. Since wrapping up axum 0.7 I have started contributing myself and will continue to do so. |
Also related: hyperium/hyper-util#66. |
Fixes #2352
Was a bit more work than I expected because hyper-util doesn't seem to support graceful shutdown yet.
@seanmonstar is this how you'd recommend doing graceful shutdown?