Trait StateStore

Source
pub trait StateStore: Send + Sync {
    // Required methods
    fn save<'life0, 'life1, 'async_trait>(
        &'life0 self,
        state: &'life1 WorkflowState,
    ) -> Pin<Box<dyn Future<Output = Result<(), WorkflowError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn load<'life0, 'life1, 'async_trait>(
        &'life0 self,
        instance_id: &'life1 WorkflowId,
    ) -> Pin<Box<dyn Future<Output = Result<WorkflowState, WorkflowError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn delete<'life0, 'life1, 'async_trait>(
        &'life0 self,
        instance_id: &'life1 WorkflowId,
    ) -> Pin<Box<dyn Future<Output = Result<(), WorkflowError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn list<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<WorkflowId>, WorkflowError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn list_by_status<'life0, 'async_trait>(
        &'life0 self,
        status: WorkflowStatus,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<WorkflowId>, WorkflowError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn cleanup<'life0, 'async_trait>(
        &'life0 self,
        retention: Duration,
    ) -> Pin<Box<dyn Future<Output = Result<u64, WorkflowError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Trait for workflow state persistence

Required Methods§

Source

fn save<'life0, 'life1, 'async_trait>( &'life0 self, state: &'life1 WorkflowState, ) -> Pin<Box<dyn Future<Output = Result<(), WorkflowError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Save workflow state

Source

fn load<'life0, 'life1, 'async_trait>( &'life0 self, instance_id: &'life1 WorkflowId, ) -> Pin<Box<dyn Future<Output = Result<WorkflowState, WorkflowError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Load workflow state

Source

fn delete<'life0, 'life1, 'async_trait>( &'life0 self, instance_id: &'life1 WorkflowId, ) -> Pin<Box<dyn Future<Output = Result<(), WorkflowError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Delete workflow state

Source

fn list<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Vec<WorkflowId>, WorkflowError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

List all workflow instances

Source

fn list_by_status<'life0, 'async_trait>( &'life0 self, status: WorkflowStatus, ) -> Pin<Box<dyn Future<Output = Result<Vec<WorkflowId>, WorkflowError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

List workflow instances by status

Source

fn cleanup<'life0, 'async_trait>( &'life0 self, retention: Duration, ) -> Pin<Box<dyn Future<Output = Result<u64, WorkflowError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Clean up old completed workflows

Implementors§