2 ms·
If you're curious check out oyashio: https://github.com/viperscape/oyashio https://github.com/viperscape/oyashio It's a thread safe spmc in Rust that uses promi
by viperscape 10y ago
If you're curious check out oyashio: https://github.com/viperscape/oyashio https://github.com/viperscape/oyashio
It's a thread safe spmc in Rust that uses promises underneath. If I were to rewrite it, I'd use a Vec with promises and a cursor of sorts, instead of the of linked list I came up with.
- yarper 10y agoYou could also use this https://doc.rust-lang.org/std/sync/struct.Condvar.html https://doc.rust-lang.org/std/sync/struct.Condvar.html (all block, notify one) to implement a "work stealing" style multiple consumers channel that'd be pretty cool. I think various incantations of this have been in and out of Rust's stdlib (I couldn't tell you why though?).