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

tokio-stream: WatchStream: yield the current value #3576

Merged
merged 3 commits into from
Mar 5, 2021

Commits on Mar 4, 2021

  1. tokio-stream: WatchStream: yield the current value

    This udptes WatchStream to always yield the current value before waiting
    for updates. This makes it possible to use it as a drop-in replacement
    for watch::Receiver when updating a Tokio 0.2 application.
    
    There is one caveat here, which is that we can't tell if the sender was
    used before. This means we might yield the current value twice if it was
    (because reading what we think is the initial value doesn't increment
    the watcher).
    
    I don't think there really is a way to fix this without changing the API
    of Receiver, so for now I went with documenting it. Let me know what you
    think.
    
    More context: tokio-rs#3575
    krallin committed Mar 4, 2021
    Configuration menu
    Copy the full SHA
    5833d3f View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    80a1314 View commit details
    Browse the repository at this point in the history
  3. swap lines

    krallin committed Mar 4, 2021
    Configuration menu
    Copy the full SHA
    62f2de4 View commit details
    Browse the repository at this point in the history