https://github.com/nightkr/async-spmc
"Safe" Rust SPMC channels
https://github.com/nightkr/async-spmc
futures-rs rust rust-async tokio
Last synced: 8 months ago
JSON representation
"Safe" Rust SPMC channels
- Host: GitHub
- URL: https://github.com/nightkr/async-spmc
- Owner: nightkr
- Created: 2023-07-20T23:43:07.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-07-20T23:45:54.000Z (almost 3 years ago)
- Last Synced: 2025-03-18T14:44:00.798Z (over 1 year ago)
- Topics: futures-rs, rust, rust-async, tokio
- Language: Rust
- Homepage:
- Size: 7.81 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.org
Awesome Lists containing this project
README
#+TITLE: SPMC (single-producer, multi-consumer) channels
This is an implementation of SPMC channels by effectively inverting a MPSC (multi-producer, single-consumer) channel. Each ready consumer sends a oneshot channel
into the MPSC channel. The producer tries to grab any available oneshot channel and fulfils it.
* (Not-so) FAQ
** Is it fast?
No. It's around 5x slower than the underlying MPSC channel under the best of circumstances.
** Is it stable?
No, it seems to explode and deadlock somewhere between 20 and 30 consumers.
** Is it reliable?
No, a receiver will drop any pending message when dropped.
** Can it summon nostril demons?
Not by itself. ~futures::channel~ might though, who knows?
** Does it depend on Tokio?
No.
** Is it on crates.io?
No.
** Why?
Sometimes experiments have to be carried out, however ill-advised.
** Is it Cyber Resilience Act-compliant?
Probably not.