-
Notifications
You must be signed in to change notification settings - Fork 27
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::Race never finishes #40
Comments
I just ran into this again — it should either be documented clearly that Race will never end even if the component streams do (both/either), or this should be fixed |
I think the current implementation is wrong in 2 ways.
An example that implements this correctly is futures: https://github.com/rust-lang/futures-rs/blob/0.3.15/futures-util/src/stream/select.rs So, I tend to fix the current behavior as a bug.
|
The specific use case I had needed to terminate the stream when either of the streams terminated, not both. It seems like there are valid use cases and intuitive explanations for either "finish when both streams finish" and "finish when either stream finishes," depending on the type of content in the stream. Is there precedent for configuring this sort of thing on the |
so hm it might be a good idea to introduce |
I'm trying to use
stream::Race
to join a couple of timer-based streams that periodically emit events before terminating. Sadly, the current implementation ofstream::Race
will never terminate as it will always returnPoll::Pending
if no sub-stream pollsReady(Some(_))
:futures-lite/src/stream.rs
Line 2312 in 0ba0f06
I'm happy to make a PR if this would be considered a bug, but I figured I'd check first since it could break users who rely on its non-termination.
The text was updated successfully, but these errors were encountered: