Function process_batch

Source
pub async fn process_batch<T, Ret, Processor: BatchProcessor<T, Ret>>(
    receiver: &Mutex<QueueReceiver<T>>,
    timeout_secs: u64,
    processor: &Processor,
    backoff: Option<&mut BackoffTracker<T>>,
) -> Result<Ret>
where T: Debug + Hash + Eq + Clone,
Expand description

Consume some items from the queue, processing and returning the result, logging errors as they occur.

  • name: the name to print in the logs.
  • timeout_secs: the entire job will be cancelled if it exceeds this time
  • processor -> defines two operations:
    • the initial function to apply separately to each individual item.
    • the final function to apply to the vec of outputs of the first stem.