Thread Safety: LazyLock<reqwest::Client> + tokio::test
#2621
-
|
I like to use This client is not behind any I know that the tokio test runtime does some things to internal timers and so on, so maybe it's just my test runtime setup, but I wanted to make sure, that |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
reqwest's Client is safe to use across threads. You might find problems if you try to use it in multiple runtimes, because of it holds onto connections and timers, and those only work if the runtime that created them is still running. |
Beta Was this translation helpful? Give feedback.
reqwest's Client is safe to use across threads.
You might find problems if you try to use it in multiple runtimes, because of it holds onto connections and timers, and those only work if the runtime that created them is still running.