-
Hello , i'm trying to write some multithread applications which basically will make http requests in multiple threads. I'm tried to use std::thread and awc packages for that but i couldn't make it. Can you write a minimalist example which you do synchronous http requests on multiple threads? |
Beta Was this translation helpful? Give feedback.
Answered by
robjtede
Jan 27, 2024
Replies: 1 comment 4 replies
-
Since std::thread::spawn(|| {
let client = awc::Client::new();
}); |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Depends what data. You can't share the client itself with an Arc, nor Request/Response types. but a response body would be Send-able.
If you want complete share-ability then I'd point you toward a thread-safe client like
reqwest
.