Hello Rustaceans, I’m Filip, and I’ve been dabbling with Rust for the past moth or so. Here’s my first contribution a Lock-free Bounded Non-Blocking Pub-Sub Queue.
The idea behind this queue is to have a Pub Sub pattern, where the size is bounded while the publisher is never blocked. Subscribers will lose data if they can’t keep up with the Publisher, but never block it. Implemented is a Bare-bones queue with only broadcast and try_recv method, Sync version with blocking recv(), and blocking recv_timeout, and a Async version with Sink and Stream Traits implemented.
All of the versions use their respective channel functions to create a (Publisher,Subscriber) tuple, while Subscribers implement the Clone Trait to add subscribers.
Comments, rants and suggestions are very welcome.