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 tokio-stream wrappers for watch and broadcast receivers #3382

Closed
peku33 opened this issue Jan 6, 2021 · 8 comments · Fixed by #3384
Closed

Add tokio-stream wrappers for watch and broadcast receivers #3382

peku33 opened this issue Jan 6, 2021 · 8 comments · Fixed by #3384
Labels
A-tokio-stream Area: The tokio-stream crate C-feature-request Category: A feature request. M-sync Module: tokio/sync

Comments

@peku33
Copy link

peku33 commented Jan 6, 2021

In tokio 0.2 watch and broadcast receivers implemented Stream.
In tokio 1.0 they don't.

While I know watch and broadcast will probably never be Stream themselves, there is some work in progress to make them convertible into Streams: #3303

While this is still in progress - is it possible to have watch and broadcast receiver wrappers added to tokio-stream?

@peku33 peku33 added A-tokio Area: The main tokio crate C-feature-request Category: A feature request. labels Jan 6, 2021
@Darksonn Darksonn added A-tokio-stream Area: The tokio-stream crate M-sync Module: tokio/sync and removed A-tokio Area: The main tokio crate labels Jan 6, 2021
@Darksonn
Copy link
Contributor

Darksonn commented Jan 6, 2021

We can add wrappers that just internally use the async-stream crate. We can't do better as the channels have no poll_recv method.

@peku33
Copy link
Author

peku33 commented Jan 6, 2021

Yes, please

@liufuyang
Copy link
Contributor

I will give a try to see if I can help adding it :)

@jhpratt
Copy link
Contributor

jhpratt commented Jan 20, 2021

This would be wonderful to have! It's the only thing preventing me from doing a full upgrade to tokio 1.0 on a major project of mine.

@liufuyang
Copy link
Contributor

Sorry I got dragged away for something else and couldn't find time finishing it up. Perhaps I can take a look at it this coming weekends. Otherwise @Darksonn might be able to give me a hand or just do this on her own if I am too slow progressing :)

@peku33
Copy link
Author

peku33 commented Jan 31, 2021

Hi, any update on this?

@Darksonn
Copy link
Contributor

Yes! The wrappers were waiting for #3464, which was just released in tokio-util v0.3.6 one hour ago.

@Darksonn
Copy link
Contributor

Darksonn commented Feb 5, 2021

The wrappers are out in tokio-stream v0.1.3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-tokio-stream Area: The tokio-stream crate C-feature-request Category: A feature request. M-sync Module: tokio/sync
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants