Closed yanns closed 5 months ago
When using the following code:
async fn say_hello(who: &str) -> Vec<String> { let input: Vec<_> = (1..=5).collect(); let results = input .into_co_stream() .map(|i| hello(i, who)) .collect() .await; results } async fn hello(i: i32, who: &str) -> String { println!("Job {i} started"); tokio::time::sleep(std::time::Duration::from_secs(1)).await; let result = format!("Task {i}: Hello {who}"); println!("Job {i} finished with result {result}"); result }
The program outputs:
Starting jobs... Job 1 started Job 2 started Job 3 started Job 4 started Job 5 started Job 5 finished with result Task 5: Hello world
and does not make any progress afterwards
Thank you for reporting this! This seems like a likely duplicate of #182. I'm going to close this in favor of that.
When using the following code:
The program outputs:
and does not make any progress afterwards