Skip to content

Commit

Permalink
Added README and CHANGELOG
Browse files Browse the repository at this point in the history
  • Loading branch information
Amjad50 committed Feb 21, 2024
1 parent 1190e31 commit 90578ce
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 0 deletions.
15 changes: 15 additions & 0 deletions CHANGELOG.md
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
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ description = "Fast, lock-free, bounded, multiple-producer, multiple-consumer, l
repository = "https://github.com/Amjad50/blink-channel.git"
keywords = ["channel", "broadcast", "mpmc", "lock-free", "no_std"]
categories = ["concurrency", "no-std"]
rust-version = "1.60.0"

[features]
unstable = []
Expand Down
30 changes: 30 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Blink-channel

[![check](https://github.com/Amjad50/blink-channel/actions/workflows/check.yml/badge.svg)](https://github.com/Amjad50/blink-channel/actions/workflows/check.yml) [![codecov](https://codecov.io/gh/Amjad50/blink-channel/graph/badge.svg?token=I4ORM3HHCK)](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)

0 comments on commit 90578ce

Please sign in to comment.