::blocking::Client::get within a spawn thread?
#2810
-
|
Given the statements like this for reqwest::blocking:
I am not using a runtime (so one would obviously derive it does not apply) but just to be sure: it would be a valid approach to spawn threads using Basically I am using an Something like this: let (tx, rx) = mpsc::channel();
for feed in feeds {
match feed {
Ok(feed) => {
// each with its own transmitter.
let arc = Arc::clone(&client);
let t = tx.clone();
thread::spawn(move || t.send(request_info(&arc, feed)));
}
Err(err) => eprintln!("{err}"),
};
}
drop(tx);
// ... |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
From what you've said so far, this is exactly what the blocking client is for and how to use it. 🤓 |
Beta Was this translation helpful? Give feedback.
From what you've said so far, this is exactly what the blocking client is for and how to use it. 🤓