Skip to content

Best practice for running some async tasks on a dedicated thread #3868

Answered by Darksonn
ririsoft asked this question in Q&A
Discussion options

You must be logged in to vote

Due to your use of recv inside the thread, you should not use spawn_blocking. Use std::thread::spawn instead. You can read why here. As for block_on, use the one on Handle. See also this post.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by ririsoft
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants