3 ms·
The async map you laid out above could be accomplished with a `Stream` in async Rust. You can turn the array into a `Stream`, have a map operation to return a f
by conradev 7y ago
The async map you laid out above could be accomplished with a `Stream` in async Rust. You can turn the array into a `Stream`, have a map operation to return a future, and then use the `buffered` method to run N at once:
https://docs.rs/futures/0.3.0/futures/stream/trait.StreamExt.html#method.buffered https://docs.rs/futures/0.3.0/futures/stream/trait.StreamExt...
Not only does the `futures` crate provide most things you'd ever want, it also has no special treatment – you can implements your own combinators in the same way that `futures` implements them if you need something off of the beaten path.