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

Implement FusedStream for FuturesOrdered #2205

Merged
merged 3 commits into from
Sep 5, 2020

Conversation

phil-opp
Copy link
Contributor

This uses the same approach as the FusedStream implementation for FuturesUnordered.

Fixes #2192

cc @taiki-e

@taiki-e
Copy link
Member

taiki-e commented Aug 31, 2020

FuturesUnordered implements FusedStream with the same logic that this PR introduces, and is_terminated field is true only when in_progress_queue.poll_next_unpin() returns None, so I think self.in_progress_queue.is_terminated() && self.queued_outputs.is_empty() is enough for this.

@phil-opp
Copy link
Contributor Author

Thanks for the suggestion, I pushed a new commit with it.

@phil-opp
Copy link
Contributor Author

The clippy failure in src/mpsc/mod.rs seems unrelated to this PR.

@taiki-e
Copy link
Member

taiki-e commented Aug 31, 2020

Yes, that will be fixed in #2203

@taiki-e taiki-e merged commit 74d6d80 into rust-lang:master Sep 5, 2020
@taiki-e
Copy link
Member

taiki-e commented Sep 5, 2020

Thanks!

@taiki-e taiki-e mentioned this pull request Oct 5, 2020
@taiki-e taiki-e added the A-stream Area: futures::stream label Jan 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-stream Area: futures::stream
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Why is there no FusedStream implementation for FuturesOrdered?
2 participants