execute_chunked

Function execute_chunked 

Source
pub async fn execute_chunked<T, I, F, Fut>(
    items: I,
    chunk_size: usize,
    max_concurrency: usize,
    operation: F,
) -> Vec<Vec<Result<T, String>>>
where I: IntoIterator, I::IntoIter: ExactSizeIterator, F: Fn(Vec<I::Item>) -> Fut + Clone + Send + 'static, Fut: Future<Output = Vec<Result<T, String>>> + Send + 'static, T: Send + 'static, I::Item: Send + Clone + 'static,
Expand description

Execute operations in parallel chunks.

Useful for operations that benefit from batching (like multi-row inserts) combined with parallel execution of batches.