zesterer / flume

A safe and fast multi-producer, multi-consumer channel.
https://crates.io/crates/flume
Apache License 2.0
2.47k stars 85 forks source link

Create a `WeakSender` type that does not keep the channel open #109

Closed phil-opp closed 2 years ago

phil-opp commented 2 years ago

Creates a WeakSender type, which can be constructed through a new Sender::downgrade method. Similar to the sync::Weak of the standard library, the WeakSender does not count towards ownership. That means that the channel is closed as soon as all Senders are closed, even if there are still active WeakSenders.

Resolves #107

zesterer commented 2 years ago

Thanks so much, this is a great PR!

zesterer commented 2 years ago

Would you be looking for a new release for this change?

phil-opp commented 2 years ago

Thanks for merging! A new release would be great, but we have a workaround for now and are fine with waiting a bit.

GermanCoding commented 1 year ago

Is there a new release planned? I'm interested in this, but it doesn't appear to be in 0.10.14

zesterer commented 1 year ago

I've just released 0.11.0 with these changes :)