pub trait TransactionalEventHandler<A, Er, Ex>: Syncwhere
A: Aggregate,{
// Required method
fn handle<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
event: &'life1 StoreEvent<A::Event>,
executor: &'life2 mut Ex,
) -> Pin<Box<dyn Future<Output = Result<(), Er>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
// Provided methods
fn delete<'life0, 'life1, 'async_trait>(
&'life0 self,
_aggregate_id: Uuid,
_executor: &'life1 mut Ex,
) -> Pin<Box<dyn Future<Output = Result<(), Er>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait { ... }
fn name(&self) -> &'static str { ... }
}Expand description
This trait is used to implement a TransactionalEventHandler. A transactional event handler is
intended to be an entity which can create, update and delete a read side. No side effects must be
performed inside of this kind on handler.
An handle operation will result in a deadlock if the implementation of this trait is used to
apply an event on an Aggregate.
Required Methods§
Sourcefn handle<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
event: &'life1 StoreEvent<A::Event>,
executor: &'life2 mut Ex,
) -> Pin<Box<dyn Future<Output = Result<(), Er>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn handle<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
event: &'life1 StoreEvent<A::Event>,
executor: &'life2 mut Ex,
) -> Pin<Box<dyn Future<Output = Result<(), Er>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Handle an event in a transactional fashion and perform a read side crate, update or delete. If an error is returned the transaction will be aborted and the handling of a command by an aggregate will return an error.
Provided Methods§
Sourcefn delete<'life0, 'life1, 'async_trait>(
&'life0 self,
_aggregate_id: Uuid,
_executor: &'life1 mut Ex,
) -> Pin<Box<dyn Future<Output = Result<(), Er>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn delete<'life0, 'life1, 'async_trait>(
&'life0 self,
_aggregate_id: Uuid,
_executor: &'life1 mut Ex,
) -> Pin<Box<dyn Future<Output = Result<(), Er>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Perform a deletion of a read side projection using the given aggregate_id.