Skip to main content

process_batch

Function process_batch 

Source
pub fn process_batch<T, F, R>(items: &[T], processor: F) -> Vec<R>
where T: Sync, F: Fn(&T) -> R + Sync + Send, R: Send,
Expand description

Process multiple items in batch with optional parallelism

Generic version of process_files_batch that works with any slice of items.

§Example

let fingerprints = vec!["abc123", "def456", "ghi789"];

let results = process_batch(&fingerprints, |fp| {
    database.query_by_fingerprint(fp)
});