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: add builder function for watch::Sender #5998

Merged
merged 6 commits into from
Sep 19, 2023

Conversation

nicflower
Copy link
Contributor

Motivation

Completing feature request #4958 regarding the watch channel part

Solution

Simply added a new builder function that takes as argument the initial value of the watched value. I used this builder also in the watch::channel function, because of this it made the Version::Initial funcion not used so I removed it

Added a method that allows to build a Sender without specifying any Receiver.
@github-actions github-actions bot added the R-loom-sync Run loom sync tests on this PR label Sep 10, 2023
tokio/src/sync/watch.rs Outdated Show resolved Hide resolved
Added a function that basically calls the watch::channel function and drops the returned receiver
@Darksonn Darksonn added A-tokio Area: The main tokio crate M-sync Module: tokio/sync labels Sep 11, 2023
Copy link
Contributor

@Darksonn Darksonn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm fine with this implementation.

tokio/src/sync/watch.rs Outdated Show resolved Hide resolved
Co-authored-by: Alice Ryhl <[email protected]>
tokio/src/sync/watch.rs Outdated Show resolved Hide resolved
Copy link
Contributor

@Darksonn Darksonn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks.

@Darksonn Darksonn merged commit 9d51b76 into tokio-rs:master Sep 19, 2023
69 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-tokio Area: The main tokio crate M-sync Module: tokio/sync R-loom-sync Run loom sync tests on this PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants