Skip to main content

RuntimeStreamAdapter

Trait RuntimeStreamAdapter 

Source
pub trait RuntimeStreamAdapter: Send + Sync {
    // Required methods
    fn publish<'life0, 'async_trait>(
        &'life0 self,
        room: RuntimeRoom,
        event: RuntimeEventEnvelope,
    ) -> Pin<Box<dyn Future<Output = Result<(), RuntimeStreamError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn subscribe<'life0, 'async_trait>(
        &'life0 self,
        room: RuntimeRoom,
    ) -> Pin<Box<dyn Future<Output = Result<BoxRuntimeEventStream, RuntimeStreamError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Transport-neutral live fanout for runtime event envelopes.

publish is best-effort: a publish with no live subscribers is not an error. Reliability and replay are the responsibility of RuntimeEventStore.

Required Methods§

Source

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

Best-effort fanout of event to all live subscribers of room.

Source

fn subscribe<'life0, 'async_trait>( &'life0 self, room: RuntimeRoom, ) -> Pin<Box<dyn Future<Output = Result<BoxRuntimeEventStream, RuntimeStreamError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Subscribes to the live event stream for room.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§