smol-rs / async-channel

Async multi-producer multi-consumer channel
Apache License 2.0
726 stars 38 forks source link

Add zero capacity bounded channel #58

Open bnyu opened 1 year ago

bnyu commented 1 year ago

A difference between zero capacity and one capacity bounded channel is that call try_send() return OK only when there is already receiver wait on it. And this is useful is somecase.

Golang and crossbeam-channel both have zero capacity bounded channel, maybe we should support it.

notgull commented 1 year ago

Adding a rendezvous channel inside of the current implementation would add some level of complexity to the implementation. I'd like to avoid that if necessary.

I'd be happy to add rendezvous channel functionality to this crate, but I'd have to see the implementation first.

al8n commented 8 months ago

Hi @notgull, anyone works on this? If not, I would like to give it a try.

notgull commented 8 months ago

Hi @notgull, anyone works on this? If not, I would like to give it a try.

Sure, go ahead!