Open yoshuawuyts opened 9 months ago
(note that this isn't an issue if you ensure that the function bodies in Stream::merge
are short-lived)
What I'm concretely proposing here is: Stream::merge
should return a new trait, ConcurrentStream
which can concurrently progress both the underlying streams and the individually handled items. That's a change from today, where Stream::merge
returns a regular Stream
which if used incorrectly may lead to the issues mentioned.
ConcurrentStream
. We may want Stream::merge
to return that instead. At the very least we should try and experiment with that.
Tmandry's post showed how progressing a stream + concurrently executing a stream can lead to timeouts - this will affect
Stream::merge
as well. Probably the better solution is #164 which can run the processing concurrently with the underlying stream.