Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stream::merge may be susceptible to stream "barbara battles buffered streams" #165

Open
yoshuawuyts opened this issue Feb 19, 2024 · 3 comments

Comments

@yoshuawuyts
Copy link
Owner

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.

@yoshuawuyts
Copy link
Owner Author

(note that this isn't an issue if you ensure that the function bodies in Stream::merge are short-lived)

@yoshuawuyts
Copy link
Owner Author

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.

@yoshuawuyts yoshuawuyts changed the title Stream::merge is susceptible to timeouts Stream::merge may be susceptible to stream "barbara battles buffered streams" Apr 12, 2024
@yoshuawuyts
Copy link
Owner Author

#164 implements ConcurrentStream. We may want Stream::merge to return that instead. At the very least we should try and experiment with that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant