The Wayback Machine - https://web.archive.org/web/20200910202652/https://github.com/rust-lang/futures-rs/pull/2112
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

Simpler selection futures #2112

Open
wants to merge 7 commits into
base: master
from
Open

Simpler selection futures #2112

wants to merge 7 commits into from

Conversation

@Lucretiel
Copy link
Contributor

Lucretiel commented Apr 2, 2020

This pull request adds first, first_all, and first_ok. These are selection functions, similar to the existing select and friends, which (unlike select) don't return the incomplete futures after finishing (simply discards them instead). This allows them to have implementations that are simpler, have less overhead, and do not require Unpin on their contents.

This pull request is in progress:

  • first! macro handled by existing select! macro.
  • Tests
    • first
    • first_all
    • first_ok, first_ok_fused
  • Resolve issues related to FusedIterator (requires #2111)

Fixes #2031 and #2110

Lucretiel added 5 commits Apr 2, 2020
- Removed FusedIterator; .fuse() is equivalent.
- FirstOk is more explicit about its use of FusedIterator.
- This design will have to wait for #2111 to be resolved; currently the
  contract of FusedFuture is not strict enough for our needs.
@Lucretiel
Copy link
Contributor Author

Lucretiel commented Apr 3, 2020

The remaining test failures seem unrelated to these changes

Lucretiel added 2 commits Apr 3, 2020
@cramertj
Copy link
Member

cramertj commented Apr 22, 2020

This looks good to me, though the dependence on #2111 worries me because I don't feel like I have a good handle on the best way to resolve that tension. Thanks for all your hard work here, though-- these combinators do look conveniently simpler.

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

Successfully merging this pull request may close these issues.

2 participants
You can’t perform that action at this time.