I'm sure I'm missing something, but I'm trying to find something like for_each_concurrent, but which will let me return a list of items too. then_concurrent doesn't exist; is there some other method that I'm missing? This is for a regular stream constructed with futures::stream::iter.
I.e., I'd like to do something like this:
let res = futures::stream::iter(files.iter())
.then_concurrent(None, |file| tokio::spawn(async move { process(file) }).await.unwrap())
.collect().await;
Hi,
I'm sure I'm missing something, but I'm trying to find something like
for_each_concurrent
, but which will let me return a list of items too.then_concurrent
doesn't exist; is there some other method that I'm missing? This is for a regular stream constructed withfutures::stream::iter
.I.e., I'd like to do something like this:
and have it process the files in parallel.