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

sync::watch: Change wording from "unseen" to "changed" #6014

Merged
merged 4 commits into from
Sep 19, 2023

Conversation

uklotzde
Copy link
Contributor

@uklotzde uklotzde commented Sep 18, 2023

Motivation

To keep the wording in the API consistent as discussed in #5962.

Solution

Rename the newly added (and yet unreleased) method mark_unseen() to mark_changed() in sync::watch::Receiver.

@github-actions github-actions bot added the R-loom-sync Run loom sync tests on this PR label Sep 18, 2023
@uklotzde
Copy link
Contributor Author

uklotzde commented Sep 18, 2023

Ups, I got it wrong. The method must be called mark_changed(). Fixed

@uklotzde uklotzde changed the title sync::watch: Change wording from "unseen" to "unchanged" sync::watch: Change wording from "unseen" to "changed" Sep 18, 2023
@uklotzde
Copy link
Contributor Author

@victor-timofei Please check if these API changes are reasonable.

@Darksonn This PR could only be merged before 1.33 is released.

tokio/src/sync/watch.rs Outdated Show resolved Hide resolved
Co-authored-by: Victor Timofei <victor@vtimothy.com>
@uklotzde
Copy link
Contributor Author

@victor-timofei I have deliberately decided to keep the existing wording of unseen at other places in the API docs. This synonym with a slightly different perspective helps to understand possible use cases.

@Darksonn Darksonn added A-tokio Area: The main tokio crate M-sync Module: tokio/sync labels Sep 19, 2023
@Darksonn Darksonn changed the title sync::watch: Change wording from "unseen" to "changed" sync::watch: Change wording from "unseen" to "changed" Sep 19, 2023
Comment on lines 647 to 648
/// Marks the state as changed.
pub fn mark_changed(&mut self) {
Copy link
Contributor

Choose a reason for hiding this comment

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

This documentation is insufficient.

That said, this should probably have been done in the previous PR. Do you want to update the docs here? Otherwise I'll open an issue for it and merge this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not sure what is expected here. I have added some docs including a possible use case.

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 enabled auto-merge (squash) September 19, 2023 13:09
@Darksonn Darksonn merged commit 8045118 into tokio-rs:master Sep 19, 2023
69 checks passed
@uklotzde uklotzde deleted the sync_watch_receiver_mark_unchanged branch September 19, 2023 16:27
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.

3 participants