Skip to content

req.send() still depends on other threads? #1393

Discussion options

You must be logged in to vote

It doesn't depend on another thread, but it does depend on a background task. The connection state management is a separate task.

Regardless, they all share the same event loop and reactor, so if you're blocking any of the tasks there, you'll see degrade performance. It's strongly recommended to never block in an async task. Anything that needs to block, you can isolate into a tokio::task::spawn_blocking and await that.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by seanmonstar
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
Converted from issue

This discussion was converted from issue #1389 on November 29, 2021 17:51.