Home

Awesome

Flume

A blazingly fast multi-producer, multi-consumer channel.

Cargo Documentation License actions-badge Casual Maintenance Intended

use std::thread;

fn main() {
    println!("Hello, world!");

    let (tx, rx) = flume::unbounded();

    thread::spawn(move || {
        (0..10).for_each(|i| {
            tx.send(i).unwrap();
        })
    });

    let received: u32 = rx.iter().sum();

    assert_eq!((0..10).sum::<u32>(), received);
}

Why Flume?

Usage

To use Flume, place the following line under the [dependencies] section in your Cargo.toml:

flume = "x.y"

Cargo Features

Flume comes with several optional features:

You can enable these features by changing the dependency in your Cargo.toml like so:

flume = { version = "x.y", default-features = false, features = ["async", "select"] }

Benchmarks

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.

Tests were performed on an AMD Ryzen 7 3700x with 8/16 cores running Linux kernel 5.11.2 with the bfq scheduler.

<img src="misc/benchmarks.png" alt="Flume benchmarks (crossbeam benchmark suite)" width="100%"/>

Status

Flume is in casual maintenance mode. This means that the crate will continue to receive critical security and bug fixes, but heavy feature development has stopped. If you're looking for a new feature, you're welcome to open a PR and I'll try to find the time to review it.

Flume has been great fun to work on, and I'm happy that it's being used successfully by so many people. I consider the crate to be largely feature-complete at this point (bar small details here and there).

License

Flume is licensed under either of: