Skip to main content

EventExporter

Trait EventExporter 

Source
pub trait EventExporter: Send + Sync {
    // Required methods
    fn export<'life0, 'life1, 'async_trait>(
        &'life0 self,
        event: &'life1 HiveEvent,
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn flush<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Trait for exporting HiveEvents to external observability systems.

When registered with HiveMindBuilder::event_exporter(), the exporter receives every event emitted by the agent runtime. Export is fire-and-forget — errors are logged but don’t block agent execution.

Must be Send + Sync for use across Tokio tasks.

Required Methods§

Source

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

Export a single event. Called for every HiveEvent emission.

Implementations should be non-blocking. For network transports, consider buffering and batch-sending.

Source

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

Flush any buffered events. Called on HiveMind shutdown.

Implementors§