Replies: 2 comments
-
The (By the way, |
Beta Was this translation helpful? Give feedback.
0 replies
-
Ah, I didn't catch that subtlety. This fixes it: let weak_sender = sender.downgrade();
drop(sender); Thanks for the insight. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Using the
.downgrade()
method to prevent a sender from keeping an MPSC receiver channel doesn't appear to be working as I'd expect. Take the following example:Output
Dropping the sender works as expected (
reader.recv()
eventually returns None). However, downgrading the sender and holding onto the downgraded instance doesn't permit the channel to close, as would be expected from the documentation.This is with tokio v1.32.0
Beta Was this translation helpful? Give feedback.
All reactions