Skip to content

Why does it seem async client not reusable across tasks? #2075

Answered by seanmonstar
zhengtong0898 asked this question in Q&A
Discussion options

You must be logged in to vote

There's nothing in reqwest::Client that is blocking, you should be able to use it across multiple tasks.

Could the loop {} in your spawned task be the problem? It will never yield, and if you're using a single threaded Tokio runtime, then when it's looping forever, the other task can never run.

Replies: 1 comment 1 reply

Comment options

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

Answer selected by zhengtong0898
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 #2074 on December 27, 2023 14:58.