Skip to main content

EventBus

Trait EventBus 

Source
pub trait EventBus: Send + Sync {
    // Required methods
    fn publish<'life0, 'async_trait>(
        &'life0 self,
        event: OrchestratorEvent,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn subscribe<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<BoxStream<'static, OrchestratorEvent>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Pluggable event bus for orchestration observability.

Required Methods§

Source

fn publish<'life0, 'async_trait>( &'life0 self, event: OrchestratorEvent, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Publishes an event.

Source

fn subscribe<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<BoxStream<'static, OrchestratorEvent>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Subscribes to future events.

Implementors§