fluxus_transformers/operator/
mod.rs1use async_trait::async_trait;
2use fluxus_utils::models::{Record, StreamResult};
3
4mod builder;
5mod filter;
6mod map;
7mod window_reduce;
8
9pub use builder::OperatorBuilder;
10pub use filter::FilterOperator;
11pub use map::MapOperator;
12pub use window_reduce::WindowReduceOperator;
13
14#[async_trait]
16pub trait Operator<In, Out>: Send {
17 async fn init(&mut self) -> StreamResult<()>;
19
20 async fn process(&mut self, record: Record<In>) -> StreamResult<Vec<Record<Out>>>;
22
23 async fn on_window_trigger(&mut self) -> StreamResult<Vec<Record<Out>>> {
25 Ok(Vec::new())
26 }
27
28 async fn close(&mut self) -> StreamResult<()>;
30}