Linked Questions

0 votes
0 answers
870 views

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 ...
WutchZone's user avatar
  • 154
1 vote
0 answers
465 views

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....
jpsalm's user avatar
  • 328
0 votes
0 answers
77 views

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 ...
Alex's user avatar
  • 49
1683 votes
43 answers
444k views

What is the difference between concurrency and parallelism?
StackUnderflow's user avatar
413 votes
22 answers
151k views

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 ...
matekm's user avatar
  • 6,030
371 votes
18 answers
176k views

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 ...
GurdeepS's user avatar
  • 67.6k
78 votes
3 answers
56k views

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 ...
Boris's user avatar
  • 1,291
27 votes
4 answers
37k views

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, ...
Josh Weinstein's user avatar
34 votes
1 answer
27k views

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 ...
Enayet Hussain's user avatar
17 votes
1 answer
15k views

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!...
Alexei Kitaev's user avatar
3 votes
2 answers
4k views

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 = ...
Akiner Alkan's user avatar
  • 7,068
3 votes
1 answer
3k views

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::...
user964375's user avatar
  • 2,471
7 votes
1 answer
3k views

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 ...
Pietro's user avatar
  • 79
3 votes
1 answer
2k views

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 ...
Foobar's user avatar
  • 8,659
2 votes
1 answer
6k views

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) ....
user avatar

15 30 50 per page