Linked Questions
25 questions linked to/from How can I perform parallel asynchronous HTTP GET requests with reqwest?
0 votes
0 answers
870 views
How do I limit simultaneous tasks with Tokio? [duplicate]
I have many tasks to be executed in parallel, but I want to execute only a few tasks at a time. For example, I have 10 tasks and I want to execute only 2 tasks simultaneously. Given this code using ...
1 vote
0 answers
465 views
How to share reqwest::Client between concurrent requests? [duplicate]
I'm having trouble getting the reqwest crate to perform a bunch of async requests while reusing the same client. If I don't use a client and just use the provided get interface, everything works fine....
0 votes
0 answers
77 views
How do I get the futures back from select_all? [duplicate]
I need to download a lot of files, but I want to process only 3 files at the same time. I'm receiving the next file URL from a Tokio MPSC channel. I need to cover the case when I'm already downloading ...
1683 votes
43 answers
444k views
What is the difference between concurrency and parallelism? [closed]
What is the difference between concurrency and parallelism?
413 votes
22 answers
151k views
What is the difference between concurrent programming and parallel programming?
What is the difference between concurrent programming and parallel programing? I asked google but didn't find anything that helped me to understand that difference. Could you give me an example for ...
371 votes
18 answers
176k views
What is the difference between concurrency, parallelism and asynchronous methods?
Concurrency is having two tasks run in parallel on separate threads. However, asynchronous methods run in parallel but on the same 1 thread. How is this achieved? Also, what about parallelism? What ...
78 votes
3 answers
56k views
How do I synchronously return a value calculated in an asynchronous Future?
I am trying to use hyper to grab the content of an HTML page and would like to synchronously return the output of a future. I realized I could have picked a better example since synchronous HTTP ...
27 votes
4 answers
37k views
How do you make a GET request in Rust?
I noticed that Rust doesn't have a builtin library to deal with HTTP, it only has a net module that deals with raw IP and TCP protocols. I need to take a &str of the URL, make a HTTP GET request, ...
34 votes
1 answer
27k views
What is the difference between `then`, `and_then` and `or_else` in Rust futures?
I am learning to use Rust futures and I am finding it extremely confusing. I feel like I am being stupid but when would then, and_then and or_else be used? What return types are expected? Please ...
17 votes
1 answer
15k views
How to execute multiple async functions at once and get the results?
I have tried Tokio tasks, but there are no working examples to execute multiple tasks at once. What is wrong with this code? fn main() { block_on(speak()); } async fn speak() { let hold = vec!...
3 votes
2 answers
4k views
How to save a file downloaded from S3 with Rusoto to my hard drive?
I am trying to download a file from a bucket with Rusoto and I am getting the file content: fn get_object(client: &TestClient, bucket: &str, filename: &str) { let get_req = ...
3 votes
1 answer
3k views
Getting multiple URLs concurrently with Hyper
I am trying to adapt the Hyper basic client example to get multiple URLs concurrently. This is the code I currently have: extern crate futures; extern crate hyper; extern crate tokio_core; use std::...
7 votes
1 answer
3k views
Join futures with limited concurrency
I have a large vector of Hyper HTTP request futures and want to resolve them into a vector of results. Since there is a limit of maximum open files, I want to limit concurrency to N futures. I've ...
3 votes
1 answer
2k views
Cannot use filter_map with buffer_unordered when concurrently executing tasks?
I'm looking at this example for concurrently downloading things in Rust. Roughly, it looks like this: #![feature(async_closure)] use futures::{stream, StreamExt}; // 0.3.13 async fn foo() { let ...
2 votes
1 answer
6k views
Return anything in async move block
So I implmented this code-example and changed it up a little. It now looks like this: pub async fn loadAllSNPData(&mut self, client: &Client) { let bodies = stream::iter(&self.snps) ....