Skip to content

when to .await JoinHandle type generated by tokio::spawn #4257

Answered by Darksonn
LIPUU asked this question in General
Discussion options

You must be logged in to vote

When you return from main, the runtime will start shutting down, which includes killing all other spawned tasks. You should await tasks when you need to wait for them to finish.

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@LIPUU
Comment options

Answer selected by LIPUU
Comment options

You must be logged in to vote
1 reply
@Darksonn
Comment options

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