pub async fn parallel_handler<T, F, Fut>(
branches: Vec<F>,
state: &Arc<ExecutionState>,
op_id: &OperationIdentifier,
parent_ctx: &DurableContext,
config: &ParallelConfig,
logger: &Arc<dyn Logger>,
) -> Result<BatchResult<T>, DurableError>where
T: Serialize + DeserializeOwned + Send + 'static,
F: FnOnce(DurableContext) -> Fut + Send + 'static,
Fut: Future<Output = Result<T, DurableError>> + Send + 'static,Expand description
Executes multiple operations in parallel.
This handler implements the parallel semantics:
- Creates a child context for each branch
- Uses ConcurrentExecutor for parallel execution
- Returns BatchResult with results for all branches
§Arguments
branches- The list of functions to execute in parallelstate- The execution state for checkpointingop_id- The operation identifier for the parallel operationparent_ctx- The parent DurableContextconfig- Parallel configurationlogger- Logger for structured logging
§Returns
A BatchResult containing results for all branches.