ensnare-org / ensnare-v1

A library for generating digital audio.
https://ensnare.me
Other
2 stars 1 forks source link

Look into bus crate #8

Closed sowbug closed 2 months ago

sowbug commented 7 months ago

https://crates.io/crates/bus

It's an SPMC queue, but unlike a work-stealer, it gives every message to every consumer.

sowbug commented 4 months ago

I think MIDI channels are just this.

sowbug commented 2 months ago

The bus crate appears to be inactive, but not because it was a bad idea. I can't find the discussion right now, but I read that the crate ends up being fairly similar to keeping a Vec of subscriber sender channels and then sending to each when you want to broadcast something. There is a nice twist that avoids a Copy on the final sender, because it can now take the original message, but otherwise it's similar to rolling your own. But this investigation did send me down a rabbit hole of actors/crossbeam channels, and I'm way better off than I was before. So I'm closing this issue, but it's had a big positive impact on the project.