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§
Sourcefn 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 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
Sourcefn handler_id(&self) -> String
fn handler_id(&self) -> String
Get the handler’s identifier