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

Early exit stream selection #1

Closed
wants to merge 13 commits into from

Conversation

414owen
Copy link
Owner

@414owen 414owen commented Mar 25, 2022

This builds on rust-lang#2583
I'll upstream this PR if/when that is merged.

dtolnay and others added 2 commits May 1, 2022 06:57
The v2 implementation uses Node 12, which is end-of-life on April 30, 2022.
See https://nodejs.org/en/about/releases/. Update to v3, which is based on
Node 16 whose support lasts until April 30, 2024.
@414owen 414owen force-pushed the early-exit-streams branch 5 times, most recently from 33c15bb to 3c27fd3 Compare May 10, 2022 16:25
khollbach and others added 8 commits May 12, 2022 04:56
LocalPool::try_run_one and run_until_stalled now correctly re-try when a
future "yields" by calling wake and returning Pending.
```
error: unresolved link to `select`
   --> futures-util/src/future/try_future/mod.rs:272:17
    |
272 |     /// using [`select!`] or [`join!`].
    |                 ^^^^^^^ no item named `select` in scope
    |
    = note: `-D rustdoc::broken-intra-doc-links` implied by `-D warnings`
    = note: `macro_rules` named `select` exists in this crate, but it is not in scope at this link's location

error: unresolved link to `join`
   --> futures-util/src/future/try_future/mod.rs:272:32
    |
272 |     /// using [`select!`] or [`join!`].
    |                                ^^^^^ no item named `join` in scope
    |
    = note: `macro_rules` named `join` exists in this crate, but it is not in scope at this link's location

error: unresolved link to `select`
   --> futures-util/src/future/try_future/mod.rs:320:27
    |
320 |     /// type when using [`select!`] or [`join!`].
    |                           ^^^^^^^ no item named `select` in scope
    |
    = note: `macro_rules` named `select` exists in this crate, but it is not in scope at this link's location

error: unresolved link to `join`
   --> futures-util/src/future/try_future/mod.rs:320:42
    |
320 |     /// type when using [`select!`] or [`join!`].
    |                                          ^^^^^ no item named `join` in scope
    |
    = note: `macro_rules` named `join` exists in this crate, but it is not in scope at this link's location

error: unresolved link to `select`
    --> futures-util/src/stream/stream/mod.rs:1802:15
     |
1802 |     /// the [`select!`] macro.
     |               ^^^^^^^ no item named `select` in scope
     |
     = note: `macro_rules` named `select` exists in this crate, but it is not in scope at this link's location
```
Although a relatively small change, it makes the code a little bit
more readable than the originally nested `match` expressions.
SeeKRelative -> SeekRelative
Fixes a minor typo by changing "a tasks" to "a task" in the
documentation comment for enter.

Signed-off-by: hasheddan <georgedanielmangum@gmail.com>
@414owen 414owen force-pushed the early-exit-streams branch 3 times, most recently from 9a34f07 to daeeec9 Compare June 1, 2022 17:32
`select_early_exit` creates a stream that produces elements while
either stream contains elements, and terminates when either stream
runs out of elements.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
7 participants