Skip to main content

ActivityNotifier

Trait ActivityNotifier 

Source
pub trait ActivityNotifier:
    Send
    + Sync
    + 'static {
    // Required methods
    fn publish<'life0, 'async_trait>(
        &'life0 self,
        event: NotifyEvent,
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn subscribe<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        tenant_id: &'life1 str,
        conversation_id: &'life2 str,
    ) -> Pin<Box<dyn Future<Output = Result<EventStream, NotifierError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
}

Required Methods§

Source

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

Fire-and-forget publish. Failures are logged but not propagated.

Source

fn subscribe<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, tenant_id: &'life1 str, conversation_id: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<EventStream, NotifierError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Subscribe to events for a specific (tenant, conversation_id). Drop the returned stream to unsubscribe.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§