pantomime-rs / pantomime

MIT License
5 stars 1 forks source link

streams: Implement MapConcat #73

Closed longshorej closed 4 years ago

longshorej commented 4 years ago

This adds Flow::map_concat and Stream::map_concat which takes a function that consumes an A and produces an iterator of Bs.

This Bs are emitted serially until the iterator is exhausted, at which point upstream is pulled for another element.

This can be used to e.g. turn a Source<Vec<A>> into a Source<A>.