pub struct WorkflowExecutor {
pub persistence: Arc<dyn PersistenceProvider>,
pub lock_provider: Arc<dyn DistributedLockProvider>,
pub queue_provider: Arc<dyn QueueProvider>,
pub lifecycle: Option<Arc<dyn LifecyclePublisher>>,
pub search: Option<Arc<dyn SearchIndex>>,
}Expand description
The core workflow executor. Processes a single workflow instance per execute() call.
Fields§
§persistence: Arc<dyn PersistenceProvider>§lock_provider: Arc<dyn DistributedLockProvider>§queue_provider: Arc<dyn QueueProvider>§lifecycle: Option<Arc<dyn LifecyclePublisher>>§search: Option<Arc<dyn SearchIndex>>Implementations§
Source§impl WorkflowExecutor
impl WorkflowExecutor
pub fn new( persistence: Arc<dyn PersistenceProvider>, lock_provider: Arc<dyn DistributedLockProvider>, queue_provider: Arc<dyn QueueProvider>, ) -> Self
pub fn with_lifecycle(self, lifecycle: Arc<dyn LifecyclePublisher>) -> Self
pub fn with_search(self, search: Arc<dyn SearchIndex>) -> Self
Sourcepub async fn execute(
&self,
workflow_id: &str,
definition: &WorkflowDefinition,
step_registry: &StepRegistry,
) -> Result<()>
pub async fn execute( &self, workflow_id: &str, definition: &WorkflowDefinition, step_registry: &StepRegistry, ) -> Result<()>
Execute a single workflow instance.
- Acquire lock
- Load instance
- Find runnable pointers
- Execute each runnable pointer’s step
- Process results
- Check for completion
- Persist
- Release lock
Auto Trait Implementations§
impl Freeze for WorkflowExecutor
impl !RefUnwindSafe for WorkflowExecutor
impl Send for WorkflowExecutor
impl Sync for WorkflowExecutor
impl Unpin for WorkflowExecutor
impl UnsafeUnpin 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