How to use async reqwest with multithreading

thank you i'll do that,
Can you tell me an exemple of multi threading with async please ?

The Tokio website has one here. Each call to tokio::spawn creates a separate task that runs in parallel to any other task.

thank you, and it will not slow down the program if I spawn a thread for each request ?

The tokio::spawn function does not create a new thread for every task. Tokio will manage a thread pool with as many threads as you have CPU cores (by default) and run all spawned tasks on those. The magic of async is that you can run many tasks concurrently without needing a thread for every task.

Oh ok , nice !
Thank you for your help !

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.