Skip to main content

parallel

Function parallel 

Source
pub fn parallel<S, T, O, F, Fut>(
    stream: S,
    concurrency: usize,
    f: F,
) -> impl Stream<Item = AppResult<O>> + Send + 'static
where S: Stream<Item = T> + Send + 'static, T: Send + 'static, O: Send + 'static, F: Fn(T) -> Fut + Clone + Send + Sync + 'static, Fut: Future<Output = AppResult<O>> + Send + 'static,
Expand description

Process up to concurrency items concurrently.

Output order is not preserved (items complete as they finish). Uses futures::stream::FuturesUnordered for zero-copy task tracking.