| Crates.io | flowly-spsc |
| lib.rs | flowly-spsc |
| version | 0.4.11 |
| created_at | 2025-06-11 08:17:17.8013+00 |
| updated_at | 2025-12-02 10:10:04.144561+00 |
| description | Flowly is a library of modular and reusable components for building robust pipelines processing audio, video and other. |
| homepage | https://github.com/flowly-team/flowly |
| repository | https://github.com/flowly-team/flowly |
| max_upload_size | |
| id | 1708315 |
| size | 36,190 |
Flowly is a modular, type‑safe, and fully asynchronous Rust library that lets you build robust, data‑driven pipelines for audio, video, and any stream‑based processing.
It is composed of several lightweight crates that can be used independently or together:
flowly-core – fundamental building blocks (streams, filters, sinks, etc.)flowly-io – I/O primitives and adapters for common media formatsflowly-service – orchestration and lifecycle management of pipeline tasksflowly-spsc – single‑producer single‑consumer zero‑allocation channelAll components are designed to work seamlessly with tokio and futures.
[!NOTE]
Flowly is still in active development. The current stable release is 0.4.6.
async-stream, futures and tokio.wasm-bindgen).$ cargo add flowly-core flowly-io flowly-service flowly-spsc
use flowly_core::{pipeline, Component};
use flowly_io::video::VideoSource;
use flowly_service::run;
use tokio::runtime::Runtime;
#[tokio::main]
async fn main() {
// Build a simple pipeline: source → filter → sink
let pipeline = pipeline![
VideoSource::new("input.mp4")?, // Component::source
flowly_core::filters::FrameThrottler::new(15), // Component::filter
flowly_io::video::VideoSink::new("output.mp4")? // Component::sink
];
// Run the pipeline
run(pipeline).await.expect("Pipeline failed");
}
The example above uses the
pipeline!macro to wire components together. Each component follows a common trait signature, making it trivial to swap implementations.
Full API reference and guides are available on docs.rs.
See the Examples folder for more comprehensive tutorials:
┌───────────────────────────────────────────────────────────────┐
│ Flowly Core (0.4) │
│ ┌─────────────────┐ ┌───────────────────────────────┐ │
│ │ Streams/Forks │←→│ Filters / Transformations │ │
│ └─────────────────┘ └───────────────────────────────┘ │
│ │ │
│ ▼ │
└───┬───────────────────────────────────────────────────────────────┘
│
▼
┌───────────────────────┐
│ Flowly Service (0.4) │ (Orchestration & lifecycle)
└───────────────────────┘
▲
│
▼
┌───────────────────────┐
│ Flowly IO (0.4) │ (I/O adapters, codecs)
└───────────────────────┘
▲
│
▼
┌───────────────────────┐
│ Flowly SPSC (0.4) │ (Zero‑allocation channel)
└───────────────────────┘
All crates expose a minimal surface and use pub use to re‑export the most important items.
This structure keeps the core lightweight while still giving you full access to high‑level features.
tokio runtime (installed as dependency)$ cargo add flowly-core flowly-io flowly-service flowly-spsc
cd examples
cargo run --example audio_pipeline
We welcome contributions!
Run the test suite:
cargo test --workspace
MIT License – see LICENSE
| Feature | Status |
|---|---|
| WASM support | ❌ |
| GPU acceleration | ❌ |
| Built‑in AI inference | ❌ |
| Extended audio codecs | ❌ |