Crates.io | blink-channel |
lib.rs | blink-channel |
version | 0.1.0 |
source | src |
created_at | 2024-02-21 01:46:45.492388 |
updated_at | 2024-02-21 01:46:45.492388 |
description | Fast, lock-free, bounded, multiple-producer, multiple-consumer, lossy, broadcast channel |
homepage | |
repository | https://github.com/Amjad50/blink-channel.git |
max_upload_size | |
id | 1147465 |
size | 47,733 |
Fast, Lock-free, Bounded, Lossy Rust broadcast channel.
Sometimes it may spin the CPU for a bit if there is a contention on a single element in the buffer for write and read operations. Could happen more often for small buffers.
This is implemented with ring buffer and atomic operations, which provide us with lock-free behavior with no extra dependencies.
The API of the blink-channel
is similar to that of the std::sync::mpsc
channels.
However, there are some differences:
no_std
environments.Due to that nature, this is useful in applications where data comes in very quick and new data is always more important than old data which can be discarded. This could be useful for example in implementing audio driver, where a small glitch but staying up to date is better than delayed audio.
The minimum supported Rust version for this crate is 1.60.0
Licensed under MIT
(LICENSE or http://opensource.org/licenses/MIT)