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.
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.