Closed pietercolpaert closed 4 years ago
I think @rubensworks made a library that does this. Might be able to steal that code.
Yes, I made asynciterator-union, which takes the union of two streams, but it doesn't do sorting. It should not be too hard to extend it with a comparator-based iterator though.
(Note to self: we may need a new abstraction, where both RoundRobinUnionIterator
and MergeSortUnionIterator
extend from it)
Now also available in this library itself: f405a7d201a1a82d5dd25bdb3c3209b89241f84f
A function
merge
on an AsyncIterator would be a great tool to e.g., merge sort different iterators:Which element is emitted next is based on a boolean condition.