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>>,
pub log_sink: Option<Arc<dyn LogSink>>,
pub artifact_store: Option<Arc<dyn ArtifactStore>>,
}Expand description
The core workflow executor. Processes a single workflow instance per execute() call.
Fields§
§persistence: Arc<dyn PersistenceProvider>Persistence.
lock_provider: Arc<dyn DistributedLockProvider>Lock provider.
queue_provider: Arc<dyn QueueProvider>Queue provider.
lifecycle: Option<Arc<dyn LifecyclePublisher>>Lifecycle.
search: Option<Arc<dyn SearchIndex>>Search.
log_sink: Option<Arc<dyn LogSink>>Log sink.
artifact_store: Option<Arc<dyn ArtifactStore>>Artifact store for OCI-compatible inputs.
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_log_sink(self, sink: Arc<dyn LogSink>) -> Self
pub fn with_lifecycle(self, lifecycle: Arc<dyn LifecyclePublisher>) -> Self
pub fn with_search(self, search: Arc<dyn SearchIndex>) -> Self
pub fn with_artifact_store(self, store: Arc<dyn ArtifactStore>) -> Self
Sourcepub async fn execute(
&self,
workflow_id: &str,
definition: &WorkflowDefinition,
step_registry: &StepRegistry,
host_context: Option<&dyn HostContext>,
) -> Result<()>
pub async fn execute( &self, workflow_id: &str, definition: &WorkflowDefinition, step_registry: &StepRegistry, host_context: Option<&dyn HostContext>, ) -> 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