Skip to main content

InputBatch

Trait InputBatch 

Source
pub trait InputBatch: Closer {
    // Required method
    fn read_batch<'life0, 'async_trait>(
        &'life0 mut self,
    ) -> Pin<Box<dyn Future<Output = Result<(MessageBatch, Option<CallbackChan>), Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

BatchInput module trait to insert one to many crate::Message into the pipeline.

Unlike the single-message Input trait, InputBatch allows modules to read multiple messages at once. The callback channel applies to the entire batch - it will be called when ALL messages in the batch have completed processing.

§Batch Callback Semantics

  • If all messages succeed: callback receives Status::Processed
  • If any messages fail: callback receives Status::Errored(errors) with error details
  • Successful messages in a partial failure are still processed through the pipeline

Required Methods§

Source

fn read_batch<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<(MessageBatch, Option<CallbackChan>), Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Read multiple messages from the input module and expected return a tuple containing the crate::MessageBatch and a crate::CallbackChan for reporting status back.

The callback applies to the entire batch and will be triggered once all messages in the batch have completed processing (or failed).

Implementors§