Skip to main content

parallel

Function parallel 

Source
pub async fn parallel<R, F, Fut>(
    _ctx: &WorkflowCtx,
    thunks: Vec<F>,
) -> Vec<Option<R>>
where F: FnOnce() -> Fut + Send + 'static, Fut: Future<Output = Result<R, Error>> + Send + 'static, R: Send + 'static,
Expand description

Run thunks concurrently and await them all (a barrier), returning one slot per thunk in submission order. A thunk that errors or panics yields None.

ctx is threaded for API symmetry with the other combinators and so later phases can add cancellation / event emission without a signature change; the concurrency cap and budget are enforced at the agent leaf inside each thunk, not here.