Module batch

Module batch 

Source
Expand description

Batch processing utilities for parallel operations.

This module provides utilities for efficiently processing multiple operations in parallel with configurable concurrency limits and error handling.

§Features

  • Parallel task execution with configurable concurrency
  • Error collection and reporting
  • Progress tracking
  • Automatic retry for failed operations
  • Rate limiting support

§Example

use chie_core::batch::{BatchProcessor, BatchConfig};

let config = BatchConfig::default().with_max_concurrent(10);
let processor = BatchProcessor::new(config);

let tasks = vec![1, 2, 3, 4, 5];
let results = processor.process_all(tasks, |num| async move {
    Ok::<_, String>(num * 2)
}).await;

println!("Successful: {}, Failed: {}", results.successful, results.failed);

Structs§

BatchConfig
Configuration for batch processing.
BatchIterator
Batch iterator for processing items in chunks.
BatchProcessor
Batch processor for parallel operations.
BatchResult
Result of batch processing.

Enums§

BatchError
Batch processing error types.

Traits§

BatchIteratorExt
Extension trait for creating batch iterators.

Functions§

parallel_map
Process items in parallel with a simple function.