pub struct ParallelProcessor { /* private fields */ }Expand description
Parallel stream processor
Implementations§
Source§impl ParallelProcessor
impl ParallelProcessor
Sourcepub fn new(
config: StreamConfig,
processor: Arc<dyn StreamProcessor>,
state_manager: Arc<StateManager>,
) -> Self
pub fn new( config: StreamConfig, processor: Arc<dyn StreamProcessor>, state_manager: Arc<StateManager>, ) -> Self
Create a new parallel processor
Sourcepub fn with_pipeline_id(
config: StreamConfig,
processor: Arc<dyn StreamProcessor>,
state_manager: Arc<StateManager>,
pipeline_id: String,
) -> Self
pub fn with_pipeline_id( config: StreamConfig, processor: Arc<dyn StreamProcessor>, state_manager: Arc<StateManager>, pipeline_id: String, ) -> Self
Create a new parallel processor with a specific pipeline ID
Sourcepub fn state_manager(&self) -> &Arc<StateManager>
pub fn state_manager(&self) -> &Arc<StateManager>
Get the state manager for external access
Sourcepub async fn save_checkpoint(&self) -> Result<()>
pub async fn save_checkpoint(&self) -> Result<()>
Save checkpoint using the state manager
Sourcepub async fn restore_checkpoint(&self) -> Result<()>
pub async fn restore_checkpoint(&self) -> Result<()>
Restore from checkpoint
Sourcepub async fn process_stream<S>(&self, stream: S) -> Result<Vec<StreamItem>>
pub async fn process_stream<S>(&self, stream: S) -> Result<Vec<StreamItem>>
Process a stream in parallel
Sourcepub async fn process_batch(
&self,
items: Vec<StreamItem>,
) -> Result<Vec<StreamItem>>
pub async fn process_batch( &self, items: Vec<StreamItem>, ) -> Result<Vec<StreamItem>>
Process a batch of items
Auto Trait Implementations§
impl Freeze for ParallelProcessor
impl !RefUnwindSafe for ParallelProcessor
impl Send for ParallelProcessor
impl Sync for ParallelProcessor
impl Unpin for ParallelProcessor
impl UnsafeUnpin for ParallelProcessor
impl !UnwindSafe for ParallelProcessor
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