pub struct WorkflowExecutor { /* private fields */ }
Expand description
Handles the execution of workflows and their tasks
The WorkflowExecutor
is responsible for:
- Evaluating workflow conditions
- Orchestrating task execution within workflows
- Managing workflow-level error handling
- Recording audit trails
Implementations§
Source§impl WorkflowExecutor
impl WorkflowExecutor
Sourcepub fn new(
task_executor: Arc<TaskExecutor>,
internal_executor: Arc<InternalExecutor>,
) -> Self
pub fn new( task_executor: Arc<TaskExecutor>, internal_executor: Arc<InternalExecutor>, ) -> Self
Create a new WorkflowExecutor
Sourcepub async fn execute(
&self,
workflow: &Workflow,
message: &mut Message,
) -> Result<bool>
pub async fn execute( &self, workflow: &Workflow, message: &mut Message, ) -> Result<bool>
Execute a workflow if its condition is met
This method:
- Evaluates the workflow condition
- Executes tasks sequentially if condition is met
- Handles error recovery based on workflow configuration
- Updates message metadata and audit trail
§Arguments
workflow
- The workflow to executemessage
- The message being processed
§Returns
Result<bool>
- Ok(true) if workflow was executed, Ok(false) if skipped, Err on failure
Auto Trait Implementations§
impl Freeze for WorkflowExecutor
impl !RefUnwindSafe for WorkflowExecutor
impl Send for WorkflowExecutor
impl Sync for WorkflowExecutor
impl Unpin for WorkflowExecutor
impl !UnwindSafe for WorkflowExecutor
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