SagaTransaction

Trait SagaTransaction 

Source
pub trait SagaTransaction<'a> {
    type Err: Into<Error> + From<Error>;

    // Required methods
    fn get_saga<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        operation_id: &'life1 Uuid,
    ) -> Pin<Box<dyn Future<Output = Result<Option<Saga>, Self::Err>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn add_saga<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        saga: &'life1 Saga,
    ) -> Pin<Box<dyn Future<Output = Result<(), Self::Err>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn update_saga<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        operation_id: &'life1 Uuid,
        new_state: SagaStateEnum,
    ) -> Pin<Box<dyn Future<Output = Result<(), Self::Err>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn delete_saga<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        operation_id: &'life1 Uuid,
    ) -> Pin<Box<dyn Future<Output = Result<(), Self::Err>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

Saga Transaction trait

Required Associated Types§

Source

type Err: Into<Error> + From<Error>

Saga Database Error

Required Methods§

Source

fn get_saga<'life0, 'life1, 'async_trait>( &'life0 mut self, operation_id: &'life1 Uuid, ) -> Pin<Box<dyn Future<Output = Result<Option<Saga>, Self::Err>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Get saga by operation_id

Source

fn add_saga<'life0, 'life1, 'async_trait>( &'life0 mut self, saga: &'life1 Saga, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Err>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Add saga

Source

fn update_saga<'life0, 'life1, 'async_trait>( &'life0 mut self, operation_id: &'life1 Uuid, new_state: SagaStateEnum, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Err>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Update saga state (only updates state and updated_at fields)

Source

fn delete_saga<'life0, 'life1, 'async_trait>( &'life0 mut self, operation_id: &'life1 Uuid, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Err>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Delete saga

Implementors§