-
Notifications
You must be signed in to change notification settings - Fork 334
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
Tokio's tutorial does not mention CancellationToken #694
Comments
I agree, but the thing |
I agree, my bad. Point stands, though. |
Yes, definitely. Perhaps it would be worth creating a tool to replace the mspc channel as well. |
I opened tokio-rs/tokio#5585 for the mpsc replacement. |
@Darksonn Does this mean we have to replace |
Yeah, pretty much. |
Cancellation Tokens should be used to notify task to shut down instead of broadcast channels closes tokio-rs#694
https://tokio.rs/tokio/topics/shutdown
This example uses an
mpsc
to propagate a shutdown request, while the recommended way of shutting down isCancellationToken
.I guess this was because
CancellationToken
wasn't stable enough yet; but after the zero-unsafe rewrite, it should be stable enough now.Solution
Adjust the documentation so it mentions
CancellationToken
in the page about shutting down.The text was updated successfully, but these errors were encountered: