pub struct WorkflowRuntime<E: TaskExecutor> { /* private fields */ }Expand description
Workflow runtime for managing workflow executions.
Implementations§
Source§impl<E: TaskExecutor + Clone + 'static> WorkflowRuntime<E>
impl<E: TaskExecutor + Clone + 'static> WorkflowRuntime<E>
Sourcepub fn new(config: ExecutorConfig, task_executor: E) -> Self
pub fn new(config: ExecutorConfig, task_executor: E) -> Self
Create a new workflow runtime.
Sourcepub fn register_workflow(&self, definition: WorkflowDefinition) -> Result<()>
pub fn register_workflow(&self, definition: WorkflowDefinition) -> Result<()>
Register a workflow definition.
Sourcepub fn unregister_workflow(&self, workflow_id: &str) -> Result<()>
pub fn unregister_workflow(&self, workflow_id: &str) -> Result<()>
Unregister a workflow definition.
Sourcepub fn get_workflow(&self, workflow_id: &str) -> Option<WorkflowDefinition>
pub fn get_workflow(&self, workflow_id: &str) -> Option<WorkflowDefinition>
Get a workflow definition.
Sourcepub fn list_workflows(&self) -> Vec<WorkflowDefinition>
pub fn list_workflows(&self) -> Vec<WorkflowDefinition>
List all registered workflows.
Sourcepub fn start_workflow(&self, workflow_id: &str) -> Result<String>
pub fn start_workflow(&self, workflow_id: &str) -> Result<String>
Start a workflow execution.
Sourcepub async fn get_execution_status(
&self,
execution_id: &str,
) -> Result<WorkflowStatus>
pub async fn get_execution_status( &self, execution_id: &str, ) -> Result<WorkflowStatus>
Get the status of a workflow execution.
Sourcepub async fn get_execution_state(
&self,
execution_id: &str,
) -> Result<WorkflowState>
pub async fn get_execution_state( &self, execution_id: &str, ) -> Result<WorkflowState>
Get the full state of a workflow execution.
Sourcepub async fn cancel_execution(&self, execution_id: &str) -> Result<()>
pub async fn cancel_execution(&self, execution_id: &str) -> Result<()>
Cancel a workflow execution.
Sourcepub async fn wait_for_completion(
&self,
execution_id: &str,
) -> Result<WorkflowState>
pub async fn wait_for_completion( &self, execution_id: &str, ) -> Result<WorkflowState>
Wait for a workflow execution to complete.
Sourcepub fn list_active_executions(&self) -> Vec<String>
pub fn list_active_executions(&self) -> Vec<String>
List all active executions.
Sourcepub fn active_execution_count(&self) -> usize
pub fn active_execution_count(&self) -> usize
Get the number of active executions.
Sourcepub async fn cleanup_completed(&self) -> usize
pub async fn cleanup_completed(&self) -> usize
Clean up completed executions.
Auto Trait Implementations§
impl<E> Freeze for WorkflowRuntime<E>
impl<E> !RefUnwindSafe for WorkflowRuntime<E>
impl<E> Send for WorkflowRuntime<E>
impl<E> Sync for WorkflowRuntime<E>
impl<E> Unpin for WorkflowRuntime<E>
impl<E> UnsafeUnpin for WorkflowRuntime<E>
impl<E> !UnwindSafe for WorkflowRuntime<E>
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