-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
46 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Changelog | ||
|
||
All notable changes to this project will be documented in this file. | ||
|
||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), | ||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). | ||
|
||
## [Unreleased] | ||
|
||
### Added | ||
|
||
- Initial implementation of the library. | ||
- Tests and benches. | ||
|
||
[unreleased]: https://github.com/Amjad50/blink-channel/compare/a9761ca3c16404ffd8c00efe0ed26fa377bb444d...HEAD |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# Blink-channel | ||
|
||
[](https://github.com/Amjad50/blink-channel/actions/workflows/check.yml) [](https://codecov.io/gh/Amjad50/blink-channel) | ||
|
||
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: | ||
|
||
- It allows for multiple consumers (receivers) and multiple prodocuers (senders). | ||
- The channel broadcasts every send to every consumer. | ||
- Lossy, the sender will overwrite old data, so receivers must be quick or they will lose the old data (don' | ||
t blink). | ||
- Implemented for `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. | ||
|
||
# Minimum Supported Rust Version (MSRV) | ||
The minimum supported Rust version for this crate is `1.60.0` | ||
|
||
# License | ||
Licensed under `MIT` ([LICENSE](./LICENSE) or http://opensource.org/licenses/MIT) |