Trait esrs::bus::EventBus

source ·
pub trait EventBus<A>: Sync
where A: Aggregate,
{ // Required method fn publish<'life0, 'life1, 'async_trait>( &'life0 self, store_event: &'life1 StoreEvent<A::Event>, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; }
Expand description

The responsibility of the EventBus trait is to publish an event on a specific bus implementation.

Required Methods§

source

fn publish<'life0, 'life1, 'async_trait>( &'life0 self, store_event: &'life1 StoreEvent<A::Event>, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Publish an Aggregate event on an EventBus defined by the user.

All the errors should be handled from within the EventBus and shouldn’t panic.

Implementors§

source§

impl<A> EventBus<A> for KafkaEventBus<A>
where Self: Send, A: Aggregate + Send + Sync, A::Event: Serialize + Sync,

source§

impl<A> EventBus<A> for RabbitEventBus<A>
where Self: Send, A: Aggregate + Send + Sync, A::Event: Serialize + Sync,