kanal icon indicating copy to clipboard operation
kanal copied to clipboard

Do you have plan to implement broadcast channel?

Open cecton opened this issue 2 years ago • 3 comments

Nice work!!

I think it would be nice to have a clear separation of the different kind of channels. I assume the one currently implemented is mpmc because both the sender and the receiver implements Clone. (Would there be a speed improvement to also implement mpsc?)

I would be really interested to see an implementation for a broadcast type of channel. You send the message once, the message needs to implement Clone, and all the receivers receive a copy of it. Like it is done by the crate async-broadcast.

cecton avatar Oct 17 '22 07:10 cecton

Thank you! Yes, maybe for 0.2 and not as a default feature in my opinion currently I'm trying not to add any new features until our code is audited completely. Kanal community can discuss implementation and requirements until then here.

fereidani avatar Oct 17 '22 07:10 fereidani

Broadcast channel disallows some optimizations like in-stack-transfer, which is the shining point of this extremely fast crate. If so, why not just use an existing crate async-broadcast

JakkuSakura avatar Oct 30 '22 13:10 JakkuSakura

I think we can do the same optimization using the signal for broadcast too. but I'm unsure to add broadcast type to Kanal. in one hand I like Kanal to be complete and featureful but in case maintaining both normal and broadcast channels together proves to be counter-productive for us. I prefer to keep Kanal away from the broadcast channels. We wait and see what happens after 0.1.0 release.

fereidani avatar Nov 12 '22 11:11 fereidani