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

improve ergonomics of watcher utils #296

Closed
clux opened this issue Jul 29, 2020 · 2 comments
Closed

improve ergonomics of watcher utils #296

clux opened this issue Jul 29, 2020 · 2 comments
Assignees
Labels
ergonomics ergonomics of the public interface question Direction unclear; possibly a bug, possibly could be improved. runtime controller runtime related

Comments

@clux
Copy link
Member

clux commented Jul 29, 2020

So that rather than doing stuff like:

    let mut applies = try_flatten_applied(watcher(events, lp)).boxed();

    while let Some(event) = applies.try_next().await? {
        handle_event(event)?;
    }

we could do things more like:

    let mut applies = watcher(events, lp).applies();

    while let Some(event) = applies.try_next().await? {
        handle_event(event)?;
    }

The key helpers involved here are:

  • utils::try_flatten_applied
  • utils::try_flatten_touched

There are two things we could do:

  • rename these (we kind of agree that the names are hard to grok)
  • exposing these as part of a public stream extension trait

So, not sure we should do this, but it's a lot of mandatory things to import when using watchers or reflectors, trying to find a slightly nicer setup.

EDIT: Restructured this issue a bit to reflect the uncertainty in direction.

@clux clux added question Direction unclear; possibly a bug, possibly could be improved. runtime controller runtime related labels Jul 29, 2020
@clux

This comment has been minimized.

@clux clux changed the title implement a WatchStream extension trait for utils? improve ergonomics of watcher utils Nov 3, 2021
@clux clux self-assigned this Nov 7, 2021
@kazk kazk added the ergonomics ergonomics of the public interface label Nov 21, 2021
@clux
Copy link
Member Author

clux commented May 13, 2022

This was done in 0.72 via #899

@clux clux closed this as completed May 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ergonomics ergonomics of the public interface question Direction unclear; possibly a bug, possibly could be improved. runtime controller runtime related
Projects
Archived in project
Development

No branches or pull requests

2 participants