Skip to main content

parallel_batch_process_chunked

Function parallel_batch_process_chunked 

Source
pub fn parallel_batch_process_chunked<T, R, F>(
    items: &[T],
    chunk_size: usize,
    config: &BatchConfig,
    func: F,
) -> Result<BatchResult<R>>
where T: Sync, R: Send, F: Fn(&[T]) -> Result<Vec<R>> + Sync + Send,
Expand description

Process a batch in chunks

This is useful when you want to control memory usage by processing items in smaller batches.

§Arguments

  • items - Items to process
  • chunk_size - Number of items per chunk
  • config - Batch configuration
  • func - Function to apply to each chunk

§Returns

Batch result containing successes and failures