Skip to main content

BroadcastDriver

Trait BroadcastDriver 

Source
pub trait BroadcastDriver:
    Send
    + Sync
    + 'static {
    // Required method
    fn broadcast<'life0, 'async_trait>(
        &'life0 self,
        event: BroadcastEvent,
    ) -> Pin<Box<dyn Future<Output = Result<(), BroadcastError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Pluggable backend for delivering broadcast events.

Implement this to route events to Pusher, Ably, Redis Pub/Sub, or any custom WebSocket transport.

Required Methods§

Source

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

Implementors§