Skip to main content

join_all

Function join_all 

Source
pub fn join_all<I>(iter: I) -> JoinAll<I::Item> 
where I: IntoIterator, I::Item: Future,
Expand description

Deterministic join_all for use in Temporal workflows.

Polls a collection of futures concurrently to completion in declaration order, returning a Vec of their results.

§Example

use temporalio_sdk::workflows::join_all;
use temporalio_sdk::WorkflowContext;
use std::time::Duration;

let timers = vec![
    ctx.timer(Duration::from_secs(1)),
    ctx.timer(Duration::from_secs(2)),
];
let results = join_all(timers).await;