streamly
streamly copied to clipboard
Change wSerial operation to interleave fairly
Currently wSerial interleaves in an asymmetric manner if more than 2 streams are interleaved by chaining the operation more than once. We can implement wSerial in the same way as wAsync except that it would interleave all streams in the same thread instead of running them asynchronously. It would require a queue of streams and they will be scheduled in a round robin fashion. It will also resolve #513 as this operation will now become associative.
We can perhaps support this using Channels. We can create a Channel for fair interleaving, it need not be concurrent.