{"id":13503021,"url":"https://github.com/zesterer/flume","last_synced_at":"2025-05-14T08:05:18.613Z","repository":{"id":37336595,"uuid":"199684110","full_name":"zesterer/flume","owner":"zesterer","description":"A safe and fast multi-producer, multi-consumer channel.","archived":false,"fork":false,"pushed_at":"2025-03-02T13:46:47.000Z","size":626,"stargazers_count":2627,"open_issues_count":34,"forks_count":85,"subscribers_count":21,"default_branch":"master","last_synced_at":"2025-05-14T08:04:59.212Z","etag":null,"topics":["channel","concurrency","rust"],"latest_commit_sha":null,"homepage":"https://crates.io/crates/flume","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zesterer.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["zesterer"]}},"created_at":"2019-07-30T15:58:22.000Z","updated_at":"2025-05-13T22:59:57.000Z","dependencies_parsed_at":"2024-06-18T13:41:05.773Z","dependency_job_id":"d4181b12-b47e-474b-ad04-dbf0afef74c5","html_url":"https://github.com/zesterer/flume","commit_stats":{"total_commits":274,"total_committers":42,"mean_commits":6.523809523809524,"dds":0.3905109489051095,"last_synced_commit":"d185c566060402370d00f0ec7f918fa97f3919b1"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zesterer%2Fflume","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zesterer%2Fflume/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zesterer%2Fflume/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zesterer%2Fflume/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zesterer","download_url":"https://codeload.github.com/zesterer/flume/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254101588,"owners_count":22014907,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["channel","concurrency","rust"],"created_at":"2024-07-31T22:02:33.738Z","updated_at":"2025-05-14T08:05:18.591Z","avatar_url":"https://github.com/zesterer.png","language":"Rust","readme":"# Flume\n\nA blazingly fast multi-producer, multi-consumer channel.\n\n[![Cargo](https://img.shields.io/crates/v/flume.svg)](\nhttps://crates.io/crates/flume)\n[![Documentation](https://docs.rs/flume/badge.svg)](\nhttps://docs.rs/flume)\n[![License](https://img.shields.io/badge/license-MIT%2FApache--2.0-blue.svg)](\nhttps://github.com/zesterer/flume)\n![actions-badge](https://github.com/zesterer/flume/workflows/Rust/badge.svg?branch=master)\n[![Casual Maintenance Intended](https://casuallymaintained.tech/badge.svg)](https://casuallymaintained.tech/)\n\n```rust\nuse std::thread;\n\nfn main() {\n    println!(\"Hello, world!\");\n\n    let (tx, rx) = flume::unbounded();\n\n    thread::spawn(move || {\n        (0..10).for_each(|i| {\n            tx.send(i).unwrap();\n        })\n    });\n\n    let received: u32 = rx.iter().sum();\n\n    assert_eq!((0..10).sum::\u003cu32\u003e(), received);\n}\n```\n\n## Why Flume?\n\n- **Featureful**: Unbounded, bounded and rendezvous queues\n- **Fast**: Always faster than `std::sync::mpsc` and sometimes `crossbeam-channel`\n- **Safe**: No `unsafe` code anywhere in the codebase!\n- **Flexible**: `Sender` and `Receiver` both implement `Send + Sync + Clone`\n- **Familiar**: Drop-in replacement for `std::sync::mpsc`\n- **Capable**: Additional features like MPMC support and send timeouts/deadlines\n- **Simple**: Few dependencies, minimal codebase, fast to compile\n- **Asynchronous**: `async` support, including mix 'n match with sync code\n- **Ergonomic**: Powerful `select`-like interface\n\n## Usage\n\nTo use Flume, place the following line under the `[dependencies]` section in your `Cargo.toml`:\n\n```toml\nflume = \"x.y\"\n```\n\n## Cargo Features\n\nFlume comes with several optional features:\n\n- `spin`: use spinlocks instead of OS-level synchronisation primitives internally for some kind of data access (may be more performant on a small number of platforms for specific workloads)\n\n- `select`: Adds support for the [`Selector`](https://docs.rs/flume/latest/flume/select/struct.Selector.html) API, allowing a thread to wait on several channels/operations at once\n\n- `async`: Adds support for the [async API](https://docs.rs/flume/latest/flume/async/index.html), including on otherwise synchronous channels\n\n- `eventual-fairness`: Use randomness in the implementation of `Selector` to avoid biasing/saturating certain events over others\n\nYou can enable these features by changing the dependency in your `Cargo.toml` like so:\n\n```toml\nflume = { version = \"x.y\", default-features = false, features = [\"async\", \"select\"] }\n```\n\n## [Benchmarks](https://what-if.xkcd.com/147/)\n\nAlthough Flume has its own extensive benchmarks, don't take it from here that Flume is quick.\nThe following graph is from the `crossbeam-channel` benchmark suite.\n\nTests were performed on an AMD Ryzen 7 3700x with 8/16 cores running Linux kernel 5.11.2 with the bfq scheduler.\n\n# \u003cimg src=\"misc/benchmarks.png\" alt=\"Flume benchmarks (crossbeam benchmark suite)\" width=\"100%\"/\u003e\n\n## Status\n\nFlume is in [casual maintenance mode](https://casuallymaintained.tech/). This means that the crate will continue to\nreceive critical security and bug fixes, but heavy feature development has stopped. If you're looking for a new\nfeature, you're welcome to open a PR and I'll try to find the time to review it.\n\nFlume has been great fun to work on, and I'm happy that it's being used successfully by so many people. I consider the\ncrate to be largely feature-complete at this point (bar small details here and there).\n\n## License\n\nFlume is licensed under either of:\n\n- Apache License 2.0, (http://www.apache.org/licenses/LICENSE-2.0)\n\n- MIT license (http://opensource.org/licenses/MIT)\n","funding_links":["https://github.com/sponsors/zesterer"],"categories":["Rust","Parallel and Async Library"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzesterer%2Fflume","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzesterer%2Fflume","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzesterer%2Fflume/lists"}