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

Implement subscribe() for watch channel #46

Closed
loafofpiecrust opened this issue Dec 18, 2021 · 0 comments · Fixed by #49
Closed

Implement subscribe() for watch channel #46

loafofpiecrust opened this issue Dec 18, 2021 · 0 comments · Fixed by #49
Milestone

Comments

@loafofpiecrust
Copy link

loafofpiecrust commented Dec 18, 2021

Tokio's watch channel has a Sender::<T>::subscribe(&self) -> Receiver<T> function, allowing you to create new receivers from just a sender. This would make my uses of a watch channel simpler, while not having to pull in tokio as a library dependency. Since the watch channel state is held just by an Arc, I suspect this would be very straightforward to add.

Edit: I just noticed that you already have this subscribe() function for dispatch channels! So, very simple to add indeed.

@austinjones austinjones linked a pull request Apr 13, 2022 that will close this issue
@austinjones austinjones added this to the 0.5.0 milestone Apr 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants