├── .github
└── workflows
│ └── ci.yml
├── .gitignore
├── Cargo.lock
├── Cargo.toml
├── LICENSE
├── README.md
├── benches
└── runtime_benchmark.rs
├── crates
├── fluxus-api
│ ├── Cargo.toml
│ ├── README.md
│ ├── src
│ │ ├── io
│ │ │ ├── collection_sink.rs
│ │ │ ├── collection_source.rs
│ │ │ └── mod.rs
│ │ ├── lib.rs
│ │ ├── operators
│ │ │ ├── filter.rs
│ │ │ ├── flat_map.rs
│ │ │ ├── map.rs
│ │ │ ├── mod.rs
│ │ │ ├── window_aggregator.rs
│ │ │ ├── window_skipper.rs
│ │ │ └── window_sorter.rs
│ │ └── stream
│ │ │ ├── datastream.rs
│ │ │ ├── mod.rs
│ │ │ └── windowed_stream.rs
│ └── tests
│ │ ├── datastreams_test.rs
│ │ ├── filter_test.rs
│ │ └── windowed_stream_test.rs
├── fluxus-core
│ ├── Cargo.toml
│ ├── README.md
│ └── src
│ │ ├── config.rs
│ │ ├── error_handling
│ │ ├── backpressure.rs
│ │ ├── mod.rs
│ │ └── retry_strategy.rs
│ │ ├── lib.rs
│ │ ├── metrics.rs
│ │ └── pipeline
│ │ ├── mod.rs
│ │ ├── processor.rs
│ │ └── status.rs
├── fluxus-runtime
│ ├── Cargo.toml
│ ├── README.md
│ └── src
│ │ ├── lib.rs
│ │ ├── runtime.rs
│ │ ├── state.rs
│ │ └── watermark.rs
├── fluxus-sinks
│ ├── Cargo.toml
│ ├── README.md
│ └── src
│ │ ├── buffered.rs
│ │ ├── console.rs
│ │ ├── dummy_sink.rs
│ │ ├── file.rs
│ │ └── lib.rs
├── fluxus-sources
│ ├── Cargo.toml
│ ├── README.md
│ └── src
│ │ ├── csv.rs
│ │ ├── generator.rs
│ │ └── lib.rs
├── fluxus-transformers
│ ├── Cargo.toml
│ ├── README.md
│ └── src
│ │ ├── lib.rs
│ │ ├── operator
│ │ ├── builder.rs
│ │ ├── filter.rs
│ │ ├── map.rs
│ │ ├── mod.rs
│ │ ├── window_match.rs
│ │ └── window_reduce.rs
│ │ ├── transform_base.rs
│ │ ├── transform_source.rs
│ │ └── transform_source_with_operator.rs
├── fluxus-utils
│ ├── Cargo.toml
│ ├── README.md
│ └── src
│ │ ├── error_converters.rs
│ │ ├── lib.rs
│ │ ├── models.rs
│ │ ├── time.rs
│ │ └── window.rs
└── fluxus
│ ├── Cargo.toml
│ ├── README.md
│ └── src
│ └── lib.rs
├── docs
├── DESIGN.md
├── Logo.md
├── architecture.png
└── images
│ └── fluxus-logo.png
└── examples
├── README.md
├── click-stream
├── Cargo.toml
├── README.md
└── src
│ └── main.rs
├── event-timestamp
├── Cargo.toml
├── README.md
└── src
│ └── main.rs
├── iot-devices
├── Cargo.toml
├── README.md
└── src
│ └── main.rs
├── log-anomaly
├── Cargo.toml
├── README.md
└── src
│ └── main.rs
├── network-log
├── Cargo.toml
├── README.md
└── src
│ └── main.rs
├── remote-csv
├── Cargo.toml
├── README.md
└── src
│ └── main.rs
├── stock-market
├── Cargo.toml
├── README.md
└── src
│ └── main.rs
├── temperature-sensor
├── Cargo.toml
├── README.md
└── src
│ └── main.rs
└── word-count
├── Cargo.toml
├── README.md
└── src
└── main.rs
/.github/workflows/ci.yml:
--------------------------------------------------------------------------------
1 | name: Rust
2 | permissions:
3 | contents: read
4 | pull-requests: write
5 |
6 | on:
7 | push:
8 | branches: [ "main", "develop" ]
9 | pull_request:
10 | branches: [ "main", "develop" ]
11 | release:
12 | types: [ published ]
13 |
14 | env:
15 | CARGO_TERM_COLOR: always
16 |
17 | jobs:
18 | build:
19 | runs-on: ubuntu-latest
20 |
21 | steps:
22 | - uses: actions/checkout@v4
23 | - name: Install Rust toolchain
24 | uses: actions-rs/toolchain@v1
25 | with:
26 | toolchain: stable
27 | components: rustfmt, clippy
28 | override: true
29 | - name: Check formatting
30 | run: cargo fmt -- --check
31 | - name: Run clippy
32 | run: cargo clippy -- -D warnings
33 | - name: Build
34 | run: cargo build --verbose
35 | - name: Run tests
36 | run: cargo test --verbose
37 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | /target
2 | .DS_Store
3 | .idea/
4 |
5 | # Added by cargo
6 | #
7 | # already existing elements were commented out
8 |
9 | #/target
10 |
--------------------------------------------------------------------------------
/Cargo.toml:
--------------------------------------------------------------------------------
1 | [workspace]
2 | members = ["crates/*", "examples/*"]
3 |
4 | resolver = "2"
5 |
6 | [workspace.package]
7 | version = "0.2.0"
8 | edition = "2024"
9 | license = "Apache-2.0"
10 | authors = ["Fluxus Team"]
11 | description = "Fluxus is a stream processing engine that provides a declarative and efficient way to process and analyze data streams."
12 | homepage = "https://github.com/lispking/fluxus"
13 | repository = "https://github.com/lispking/fluxus"
14 | readme = "README.md"
15 | categories = ["database", "development-tools", "asynchronous", "science"]
16 | keywords = [
17 | "stream-processing",
18 | "real-time",
19 | "data-processing",
20 | "analytics",
21 | "async",
22 | ]
23 |
24 | [workspace.metadata.release]
25 | publish = true
26 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | # Fluxus Stream Processing Engine
6 |
7 | [](https://crates.io/crates/fluxus-core)
8 | [](https://docs.rs/fluxus-core)
9 | [](https://opensource.org/license/apache-2-0)
10 | [
](https://github.com/lispking/fluxus/actions?query=branch%3Amain)
11 | [](https://deepwiki.com/lispking/fluxus)
12 |
13 |
14 | Fluxus is a lightweight stream processing engine written in Rust, designed for efficient real-time data processing and analysis.
15 |
16 | 
17 |
18 | ## Features
19 |
20 | - High-performance stream processing
21 | - Flexible windowing operations (Tumbling, Sliding, Session windows)
22 | - Parallel processing support
23 | - Rich set of stream operations (map, filter, aggregate)
24 | - Type-safe API
25 | - Easy to use and extend
26 |
27 | ## Project Structure
28 |
29 | - `crates/fluxus` - Main crate containing the Fluxus engine and its dependencies
30 | - `crates/fluxus-api` - Core API definitions and interfaces
31 | - `crates/fluxus-core` - Core implementations and data structures
32 | - `crates/fluxus-runtime` - Runtime engine and execution environment
33 | - `crates/fluxus-sinks` - Sink implementations for different data sinks (e.g., Kafka, Console)
34 | - `crates/fluxus-sources` - Source implementations for different data sources (e.g., Kafka, Console)
35 | - `crates/fluxus-transforms` - Transformations for stream processing (e.g., map, filter, aggregate)
36 | - `crates/fluxus-utils` - Utility functions and helpers
37 | - `examples` - Example applications demonstrating usage
38 |
39 | ## Examples
40 |
41 | The project includes several example applications that demonstrate different use cases:
42 |
43 | ### Word Count
44 |
45 | Simple word frequency analysis in text streams using tumbling windows.
46 |
47 | ```bash
48 | cargo run --example word-count
49 | ```
50 |
51 | ### Temperature Sensor Analysis
52 |
53 | Processing and analyzing temperature sensor data with sliding windows.
54 |
55 | ```bash
56 | cargo run --example temperature-sensor
57 | ```
58 |
59 | ### Click Stream Analysis
60 |
61 | Analyzing user click streams with session windows.
62 |
63 | ```bash
64 | cargo run --example click-stream
65 | ```
66 |
67 | ### Network Log Analysis
68 |
69 | Processing network logs with sliding windows and aggregations.
70 |
71 | ```bash
72 | cargo run --example network-log
73 | ```
74 |
75 | ### Remote CSV Data Processing
76 |
77 | Processing CSV data from remote sources like GitHub.
78 |
79 | ```bash
80 | cargo run --example remote-csv
81 | ```
82 |
83 | ### View Available Examples
84 |
85 | To see all available examples and options:
86 |
87 | ```bash
88 | cargo run --example
89 | ```
90 |
91 | ## Using Fluxus in Your Project
92 |
93 | To use Fluxus in your project, add it as a dependency using cargo:
94 |
95 | ```bash
96 | cargo add fluxus --features full
97 | ```
98 |
99 | This will add Fluxus with all available features to your project. After adding the dependency, you can start using Fluxus in your code. Check out the examples section below for usage examples.
100 |
101 | ## Getting Started
102 |
103 | 1. Clone the repository:
104 |
105 | ```bash
106 | git clone https://github.com/lispking/fluxus.git
107 | cd fluxus
108 | ```
109 |
110 | 2. Build the project:
111 |
112 | ```bash
113 | cargo build
114 | ```
115 |
116 | 3. Run the examples:
117 |
118 | ```bash
119 | cargo run --example [example-name]
120 | ```
121 |
122 | ## Development
123 |
124 | ### Prerequisites
125 |
126 | - Rust 1.75+
127 | - Cargo
128 |
129 | ### Building
130 |
131 | ```bash
132 | cargo build
133 | ```
134 |
135 | ### Testing
136 |
137 | ```bash
138 | cargo test
139 | ```
140 |
141 | ## License
142 |
143 | This project is licensed under the Apache License 2.0 - see the [LICENSE](LICENSE) file for details.
144 |
145 | ## Star History
146 |
147 | [](https://www.star-history.com/#lispking/fluxus&Date)
148 |
149 | ### Thank you for your support and participation ❤️
150 |
151 |
156 |
--------------------------------------------------------------------------------
/benches/runtime_benchmark.rs:
--------------------------------------------------------------------------------
1 | use async_trait::async_trait;
2 | use criterion::{Criterion, criterion_group, criterion_main};
3 | use fluxus_core::ParallelConfig;
4 | use fluxus_runtime::RuntimeContext;
5 | use fluxus_sinks::Sink;
6 | use fluxus_sources::Source;
7 | use fluxus_transformers::Operator;
8 | use fluxus_utils::models::{Record, StreamResult};
9 | use std::sync::Arc;
10 | use tokio::sync::Mutex;
11 |
12 | // Dummy Source for benchmarking
13 | pub struct DummySource {
14 | data: Vec,
15 | index: usize,
16 | }
17 |
18 | #[async_trait]
19 | impl Source for DummySource {
20 | async fn init(&mut self) -> StreamResult<()> {
21 | Ok(())
22 | }
23 |
24 | async fn next(&mut self) -> StreamResult