async-rs / parallel-stream

Data parallelism library for async-std.
https://docs.rs/parallel-stream
Apache License 2.0
93 stars 16 forks source link

Filter Map: Add to project #10

Open CollinValley opened 4 years ago

CollinValley commented 4 years ago

This follows, pretty closely, the pattern used to create Map. The new function spawns a ton of tasks to process each value from the input stream, which are then collected into a channel. Values are pulled from the channel and output via poll_next. The only substantive difference between this and Map is that the provided closure must return a future that yields an Option, rather than a T.