smol-rs / async-channel

Async multi-producer multi-consumer channel
Apache License 2.0
769 stars 39 forks source link

Document why we notify all streams when sending a single message #57

Open Ten0 opened 1 year ago

Ten0 commented 1 year ago

https://github.com/smol-rs/async-channel/blob/a0ba218942788fd521766c65b23a691f5403d71c/src/lib.rs#L204-L208

It's unclear to me why all streams are woken up instead of a single one when sending a message. (That is, why don't streams and recv behave in the same way, when the stream is typically essentially "polling recv forever").

Would it be possible to document that further?

Thanks,