Skip to main content

llm_optimizer_processor/pipeline/
mod.rs

1//! Stream processing pipeline module
2//!
3//! This module provides a flexible, composable API for building and executing stream
4//! processing pipelines with support for:
5//! - Fluent pipeline builder API
6//! - Stream operators (map, filter, flatmap, key_by, window, aggregate)
7//! - Event ingestion and processing
8//! - Watermark propagation
9//! - Window assignment and triggering
10//! - State management
11//! - Result emission
12//!
13//! # Example
14//!
15//! ```rust,no_run
16//! use processor::pipeline::{StreamPipelineBuilder, StreamOperator};
17//! use processor::config::{WindowConfig, StateBackend};
18//! use std::time::Duration;
19//!
20//! # async fn example() -> anyhow::Result<()> {
21//! // Build a stream processing pipeline
22//! let pipeline = StreamPipelineBuilder::new()
23//!     .with_name("latency-aggregator")
24//!     .with_parallelism(4)
25//!     .with_window(WindowConfig::tumbling(60_000))
26//!     .with_watermark_delay(Duration::from_secs(5))
27//!     .with_state_backend(StateBackend::Memory)
28//!     .build()?;
29//!
30//! // Create an executor and run the pipeline
31//! // let executor = pipeline.create_executor();
32//! // executor.run().await?;
33//! # Ok(())
34//! # }
35//! ```
36
37pub mod builder;
38pub mod executor;
39pub mod operator;
40pub mod normalization_operator;
41
42pub use builder::{StreamPipelineBuilder, StreamPipeline, PipelineConfig};
43pub use executor::{StreamExecutor, ExecutorStats};
44pub use operator::{
45    StreamOperator, MapOperator, FilterOperator, FlatMapOperator,
46    KeyByOperator, WindowOperator, AggregateOperator, DeduplicationOperator,
47    OperatorContext, DeduplicationStats,
48};
49pub use normalization_operator::{NormalizationOperator, NormalizationStats, TimestampedEvent};