pub struct ParallelExecutor;Expand description
Executes parallel steps by running multiple steps concurrently
Implementations§
Source§impl ParallelExecutor
impl ParallelExecutor
Sourcepub fn execute_parallel_step(
workflow: &Workflow,
state: &mut WorkflowState,
step_id: &str,
parallel_step: &ParallelStep,
) -> WorkflowResult<()>
pub fn execute_parallel_step( workflow: &Workflow, state: &mut WorkflowState, step_id: &str, parallel_step: &ParallelStep, ) -> WorkflowResult<()>
Execute a parallel step
Executes multiple steps concurrently, respecting the max_concurrency limit. Waits for all parallel steps to complete before returning.
§Arguments
workflow- The workflow containing the stepstate- The current workflow statestep_id- The ID of the parallel step to executeparallel_step- The parallel step configuration
§Returns
Returns Ok(()) if all parallel steps executed successfully,
or an error if any step failed.
Sourcepub fn execute_parallel_step_with_limit(
workflow: &Workflow,
state: &mut WorkflowState,
step_id: &str,
parallel_step: &ParallelStep,
max_concurrency: usize,
) -> WorkflowResult<()>
pub fn execute_parallel_step_with_limit( workflow: &Workflow, state: &mut WorkflowState, step_id: &str, parallel_step: &ParallelStep, max_concurrency: usize, ) -> WorkflowResult<()>
Execute parallel steps with a concurrency limit
Executes multiple steps concurrently, limiting the number of concurrent executions to the specified max_concurrency value.
§Arguments
workflow- The workflow containing the stepstate- The current workflow statestep_id- The ID of the parallel step to executeparallel_step- The parallel step configurationmax_concurrency- The maximum number of concurrent executions
§Returns
Returns Ok(()) if all parallel steps executed successfully,
or an error if any step failed.
Sourcepub fn get_parallel_steps(parallel_step: &ParallelStep) -> &[String]
pub fn get_parallel_steps(parallel_step: &ParallelStep) -> &[String]
Get the steps to execute in parallel
Sourcepub fn get_max_concurrency(parallel_step: &ParallelStep) -> usize
pub fn get_max_concurrency(parallel_step: &ParallelStep) -> usize
Get the max concurrency from a parallel step
Sourcepub fn validate_parallel_step(
parallel_step: &ParallelStep,
) -> WorkflowResult<()>
pub fn validate_parallel_step( parallel_step: &ParallelStep, ) -> WorkflowResult<()>
Validate a parallel step
Checks that the parallel step is valid:
- Has at least one step to execute
- max_concurrency is greater than 0
Auto Trait Implementations§
impl Freeze for ParallelExecutor
impl RefUnwindSafe for ParallelExecutor
impl Send for ParallelExecutor
impl Sync for ParallelExecutor
impl Unpin for ParallelExecutor
impl UnwindSafe for ParallelExecutor
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more