Skip to main content

Module batch_processor

Module batch_processor 

Source
Expand description

Explicit batch processor — extends the default Runnable::batch with knobs that the trait method intentionally keeps simple:

  • max_concurrency — separate from RunnableConfig’s default, so the same runnable can be batched at different concurrencies in different call sites without per-config gymnastics.
  • return_exceptions — when true, the processor returns Vec<Result<O, CognisError>> so partial failures surface per-input. The default Runnable::batch short-circuits on the first error.
  • wave_delay — optional pause between scheduling waves, useful when the underlying service has rate-limit windows that aren’t well-captured by per-call backoff.

Customization: implement crate::Runnable for an entirely custom batch strategy (e.g. server-side batching). Otherwise, use BatchProcessor::process for the standard concurrency-bounded path.

Structs§

BatchOptions
Settings for BatchProcessor.
BatchProcessor
Explicit batch processor for a single inner runnable.