Are futures::Shared Fused correctly?

Hi there, I'm not sure if I found and issue or just misunderstand something.
When I have a Shared of a FusedFuture the ask it if it is_terminated() I get false even though the underlying future is terminated1.

As far as I can tell the Shared has to have been polled itself to return true from is_terminated()2

Is there a way to tell that the Shared<onshot::Receiver> is terminated without polling the Shared itself? Could there be a way to implement FusedFuture for Shared<F> where F: FusedFuture?

Thank you

Actually, most of the FusedFuture impls behave in this manner.

Consider using a tokio::sync::watch channel instead.

1 Like

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.