watch::Receiver and broadcast::Receiver cannot be composed #3123
Labels
A-tokio
Area: The main tokio crate
C-feature-request
Category: A feature request.
M-sync
Module: tokio/sync
Is your feature request related to a problem? Please describe.
In our codebase we have some Futures implemented on top of
watch::Receiver
. This works fine in0.2
aswatch::Receiver
implementedStream
, which could be delegated to.But now there's only one
async fn
(changed()
) which can't be polled over in aFuture
implementation (unless the resulting opaque future is boxed up and stored, which seems hacky).Describe the solution you'd like
Not sure, maybe reinstate the
Stream
implementation? Or, in fact, maybe just a function to register aContext
would suffice... Doesn't really matter to me as long as the API can be used fromFuture::poll()
.Describe alternatives you've considered
I looked if I could use
broadcast
instead, but in fact there's the same problem, it also only exposes opaqueFuture
/Stream
types.The text was updated successfully, but these errors were encountered: