Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/occlum/flume
A blazingly fast multi-producer, multi-consumer channel. Forked for SGX support.
https://github.com/occlum/flume
Last synced: about 1 month ago
JSON representation
A blazingly fast multi-producer, multi-consumer channel. Forked for SGX support.
- Host: GitHub
- URL: https://github.com/occlum/flume
- Owner: occlum
- License: apache-2.0
- Created: 2021-02-05T04:38:28.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2021-05-11T06:15:52.000Z (over 3 years ago)
- Last Synced: 2024-08-02T05:23:15.569Z (4 months ago)
- Language: Rust
- Size: 435 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE-APACHE
Awesome Lists containing this project
- awesome-blazingly-fast - flume - A blazingly fast multi-producer, multi-consumer channel. Forked for SGX support. (Rust)
- Awesome-SGX-Open-Source - https://github.com/occlum/flume
README
# Flume
A blazingly fast multi-producer, multi-consumer channel.
[![Cargo](https://img.shields.io/crates/v/flume.svg)](
https://crates.io/crates/flume)
[![Documentation](https://docs.rs/flume/badge.svg)](
https://docs.rs/flume)
[![License](https://img.shields.io/badge/license-MIT%2FApache--2.0-blue.svg)](
https://github.com/zesterer/flume)
![actions-badge](https://github.com/zesterer/flume/workflows/Rust/badge.svg?branch=master)```rust
let (tx, rx) = flume::unbounded();thread::spawn(move || (0..10).for_each(|i| { tx.send(i); }));
let received = rx
.iter()
.sum();assert_eq!((0..10).sum(), received);
```## Why Flume?
- **Featureful**: Unbounded, bounded and rendezvous queues
- **Fast**: Always faster than `std::sync::mpsc` and sometimes `crossbeam-channel`
- **Safe**: No `unsafe` code anywhere in the codebase!
- **Flexible**: `Sender` and `Receiver` both implement `Send + Sync + Clone`
- **Familiar**: Drop-in replacement for `std::sync::mpsc`
- **Capable**: Additional features like MPMC support and send timeouts/deadlines
- **Simple**: Few dependencies, minimal codebase, fast to compile
- **Asynchronous**: `async` support, including mix 'n match with sync code
- **Ergonomic**: Powerful `select`-like interface## Usage
To use Flume, place the following line under the `[dependencies]` section in your `Cargo.toml`:
```
flume = "x.y"
```if use flume in SGX (based on rust-sgx-sdk), place the following line under the `[dependencies]` section in your `Cargo.toml` and prepare incubator-teaclave-sgx-sdk envirenments according to flume's `Cargo.toml`:
```
flume = { git = "https://github.com/ShuochengWang/flume.git", branch = "sgx", default-features = false, features = ["sgx"] }
```## [Benchmarks](https://what-if.xkcd.com/147/)
Although Flume has its own extensive benchmarks, don't take it from here that Flume is quick.
The following graph is from the `crossbeam-channel` benchmark suite.#
## License
Flume is licensed under either of:
- Apache License 2.0, (http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (http://opensource.org/licenses/MIT)