EventHandler

Trait EventHandler 

Source
pub trait EventHandler: Send + Sync {
    // Required methods
    fn handle_event<'life0, 'async_trait>(
        &'life0 self,
        event: JetstreamEvent,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn handler_id(&self) -> String;
}
Expand description

Trait for handling Jetstream events

Required Methods§

Source

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

Handle a received event

Source

fn handler_id(&self) -> String

Get the handler’s identifier

Implementors§