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

Add an example on how to use watch with a loop - example by Alice Ryhl #6892

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

pielgrzym
Copy link

Hi,

PR updates docs to showcase using of watch in a loop. I got this example from Tokio discord, since I could not wrap my head around how to use watch. The author of the example asked me to contribute it to documentation so here I am.

@github-actions github-actions bot added the R-loom-sync Run loom sync tests on this PR label Oct 9, 2024
@mox692
Copy link
Member

mox692 commented Oct 12, 2024

PR updates docs to showcase using of watch in a loop.

As far as I know, we already have a example of using changed in a loop: https://docs.rs/tokio/latest/tokio/sync/watch/#examples

Is this something you are looking for?

@mox692 mox692 added A-tokio Area: The main tokio crate M-sync Module: tokio/sync labels Oct 12, 2024
@Darksonn
Copy link
Contributor

Yes, it looks like the example is duplicated. Is there something we can do to make the existing example more visible?

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