Flume

A safe, blazingly fast multi-producer, multi-consumer channel for Rust

Library
Cargo
v0.12.0
3,077 stars
MIT OR Apache-2.0

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
51 /100 Fair
Development Activity 40
Maintenance 12
Community 52
Maturity 60
Momentum 40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation. How we score it →
78 /100 Good
Architecture 80
Code Quality 82
Innovation 76
Learning Curve 75

Flume is a Rust channel library offering a drop-in, ergonomic alternative to std::sync::mpsc with true multi-producer, multi-consumer (MPMC) semantics. It supports unbounded, bounded, and rendezvous queues, is implemented with zero unsafe code, and works across both synchronous threads and async runtimes.

Benchmarks consistently show flume outperforming the standard library’s channel and, in many workloads, crossbeam-channel as well, while keeping its dependency footprint and compile times minimal. A select!-like macro lets code wait on multiple channels at once, and senders/receivers are Clone + Send + Sync for flexible fan-in/fan-out patterns.

What You Get

  • Unbounded, bounded, and rendezvous channel variants behind one consistent API
  • Zero unsafe code in the core implementation, verified by the crate’s own claims and structure
  • Native async support (futures-sink/futures-core) so the same channel works in sync threads and async tasks
  • A select!-style macro (select feature) for waiting on multiple channels simultaneously
  • Cloneable, Send + Sync Sender and Receiver handles for straightforward fan-in/fan-out concurrency patterns
  • An eventual-fairness feature for randomized selection among ready channels to avoid starvation

Common Use Cases

  • Worker pool fan-in - multiple producer threads send results to a single consumer that aggregates them
  • Async task coordination - bridge sync producer threads with an async consumer task (or vice versa) without manual signaling
  • Drop-in std::sync::mpsc replacement - swap in flume for existing std::sync::mpsc code to get MPMC support and better throughput
  • Event/command buses - use select! across several channels to implement a simple actor-style event loop

Under The Hood

Architecture - Flume centers on a shared internal queue guarded by an efficient signaling mechanism (src/signal.rs) that can wake either a parked OS thread or a polled async task, letting src/lib.rs expose a single Sender/Receiver API that works transparently across sync and async contexts; src/async.rs implements the Sink/Stream adapters, and src/select.rs implements the multi-channel select! macro used to wait on several receivers/senders at once.

Tech Stack - Pure Rust (2018 edition, MSRV 1.78), with a deliberately small dependency set: spin for an optional spinlock mode, and optional futures-sink/futures-core/fastrand gated behind the async, select, and eventual-fairness Cargo features respectively, keeping the default build lean and fast to compile.

Code Quality - The tests/ directory contains focused integration tests per behavior (mpsc.rs, async.rs, select.rs, same_channel.rs, zero.rs, golang.rs for Go-channel-style semantics), and benches/ includes Criterion-based benchmarks comparing against std::sync::mpsc and crossbeam-channel; the README explicitly advertises ‘no unsafe code anywhere in the codebase,’ a strong safety signal for a low-level concurrency primitive.

API Design - The public surface mirrors std::sync::mpsc closely (unbounded(), bounded(n), .send(), .recv(), .iter()) so existing code can often switch to flume with minimal changes, while adding async variants (.send_async(), .recv_async()) and a select! macro for more advanced coordination — a design that trades a slightly larger API surface for meaningfully more capability than the standard library channel.

Used by 5 apps in this directory

Rust
54%
Other

Cap

Team Chat · Video Conferencing

22,884

Open source Loom alternative with GPU-accelerated recording, instant share links, AI summaries, and full self-hosting via Docker Compose.

View details
89
Repo Health
81
Technical
64
Dependency
Built with
Rust 54%
TypeScript 42%
Updated 4 days ago
Java
34%
Apache 2.0

Enso

Analytics · Data Engineering · Low Code Platforms

7,441

A visual and textual programming platform for data prep and analysis where the node graph and the underlying Enso code are always perfectly in sync, built by an Alteryx co-founder on a GraalVM engine.

View details
59
Repo Health
90
Technical
61
Dependency
Built with
Java 34%
TypeScript 27%
Scala 26%
Updated 1 months ago
Rust
65%
Other

GitButler

AI Development · Developer Tools · Devops

21,726

Git, but better — a modern version control client with stacked branches, parallel workflows, unlimited undo, and first-class support for AI-powered development.

View details
89
Repo Health
84
Technical
66
Dependency
Built with
Rust 65%
TypeScript 22%
Svelte 10%
Updated 4 days ago
Rust
93%
Apache 2.0

helix-db

Databases

6,102

A graph-vector database built from scratch in Rust that unifies graph traversal, vector search, key-value, and relational storage into a single platform for AI applications.

View details
86
Repo Health
80
Technical
80
Dependency
Built with
Rust 93%
Updated 5 days ago
Rust
100%
Other

Meilisearch

Search

59,424

Lightning-fast hybrid search engine with AI-powered semantic and full-text retrieval for modern applications.

View details
89
Repo Health
88
Technical
68
Dependency
Built with
Rust 100%
Updated 1 weeks ago

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers