smol-rs / futures-lite

Futures, streams, and async I/O combinators.
Apache License 2.0
439 stars 25 forks source link

Missing StreamExt::for_each_concurrent #26

Closed andrewbanchich closed 1 year ago

andrewbanchich commented 3 years ago

I'm moving from futures to futures-lite but noticed this is missing StreamExt::for_each_concurrent.

Iggdraisil commented 2 years ago

Any progress on this?

notgull commented 1 year ago

You can effectively recreate the for_each_concurrent combinator by spawning each future into an executor, collecting those task handles into a list and then polling those task handles. This is the recommended solution, especially since the futures implementation has footguns in it.