Skip to main content

run_parallel

Function run_parallel 

Source
pub fn run_parallel<T, R, F>(
    input: Vec<T>,
    num_partitions: usize,
    worker: F,
) -> Vec<R>
where T: Send, R: Send, F: Fn(Vec<T>) -> Vec<R> + Sync + Send,
Expand description

Split input into num_partitions chunks, run worker over each chunk in parallel, and concatenate the results in the same order the chunks were emitted in.