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§
- Batch
Config - Configuration for batch processing.
- Batch
Iterator - Batch iterator for processing items in chunks.
- Batch
Processor - Batch processor for parallel operations.
- Batch
Result - Result of batch processing.
Enums§
- Batch
Error - Batch processing error types.
Traits§
- Batch
Iterator Ext - Extension trait for creating batch iterators.
Functions§
- parallel_
map - Process items in parallel with a simple function.