Crates.io | blinkcast |
lib.rs | blinkcast |
version | 0.2.0 |
source | src |
created_at | 2024-02-21 12:01:39.852229 |
updated_at | 2024-02-22 15:49:41.546461 |
description | Fast, bounded, multiple-producer, multiple-consumer, lossy, broadcast channel |
homepage | |
repository | https://github.com/Amjad50/blinkcast.git |
max_upload_size | |
id | 1147957 |
size | 65,248 |
Fast, Bounded, Lossy Rust broadcast channel with support for no_std
targets.
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, it may be considered lock-free, as we
don't use Lock
premitive, but the implementation may spin waiting for a contending
writer/reader to finish accessing a specific node. Its very rare, but
maybe I won't call it lock-free
in the strict sense.
The API of the blinkcast
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.
See the documentation for examples.
The minimum supported Rust version for this crate is 1.61.0
Licensed under MIT
(LICENSE or http://opensource.org/licenses/MIT)