Skip to content

Tokio::select! sync operation #4011

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

You must be logged in to vote

Generally one of the fundamental differences between async and sync is that sync operations simply cannot be cancelled, and that sync operations are blocking. The article behind that link has more background on this, and mentions some ways to offload the synchronous work to a thread pool, which may or may not work for you depending on the nature of the synchronous work.

If possible, it would be best to make your sync operation async.

Replies: 1 comment 1 reply

Comment options

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

Answer selected by sandeepmukh
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