pub struct StreamEngine { /* private fields */ }Expand description
Unified stream processing engine.
Implementations§
Source§impl StreamEngine
impl StreamEngine
pub fn new() -> Self
Sourcepub fn create_processor(
&mut self,
name: &str,
workflow_id: &str,
source: StreamSource,
window: Option<ProcessingWindow>,
max_queue_size: usize,
) -> WorkflowResult<String>
pub fn create_processor( &mut self, name: &str, workflow_id: &str, source: StreamSource, window: Option<ProcessingWindow>, max_queue_size: usize, ) -> WorkflowResult<String>
Create a stream processor.
Sourcepub fn start(&mut self, stream_id: &str) -> WorkflowResult<()>
pub fn start(&mut self, stream_id: &str) -> WorkflowResult<()>
Start consuming from a stream.
Sourcepub fn pause(&mut self, stream_id: &str) -> WorkflowResult<()>
pub fn pause(&mut self, stream_id: &str) -> WorkflowResult<()>
Pause stream consumption.
Sourcepub fn stop(&mut self, stream_id: &str) -> WorkflowResult<()>
pub fn stop(&mut self, stream_id: &str) -> WorkflowResult<()>
Stop a stream processor.
Sourcepub fn checkpoint(
&mut self,
stream_id: &str,
offset: u64,
items_processed: u64,
) -> WorkflowResult<()>
pub fn checkpoint( &mut self, stream_id: &str, offset: u64, items_processed: u64, ) -> WorkflowResult<()>
Force checkpoint at current position.
Sourcepub fn add_fork(
&mut self,
stream_id: &str,
name: &str,
condition: &str,
target_workflow_id: &str,
) -> WorkflowResult<String>
pub fn add_fork( &mut self, stream_id: &str, name: &str, condition: &str, target_workflow_id: &str, ) -> WorkflowResult<String>
Add a fork to split stream by condition.
Sourcepub fn get_processor(&self, stream_id: &str) -> WorkflowResult<&StreamProcessor>
pub fn get_processor(&self, stream_id: &str) -> WorkflowResult<&StreamProcessor>
Get processor status.
Sourcepub fn list_processors(&self) -> Vec<&StreamProcessor>
pub fn list_processors(&self) -> Vec<&StreamProcessor>
List all processors.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for StreamEngine
impl RefUnwindSafe for StreamEngine
impl Send for StreamEngine
impl Sync for StreamEngine
impl Unpin for StreamEngine
impl UnsafeUnpin for StreamEngine
impl UnwindSafe for StreamEngine
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more