pub struct MemoryRuntimeStreamAdapter { /* private fields */ }Expand description
In-memory RuntimeStreamAdapter for tests and single-instance setups.
Each RuntimeRoom is backed by a tokio::sync::broadcast channel.
Slow consumers receive RuntimeStreamError::Lagged items rather than
blocking publishers.
Implementations§
Trait Implementations§
Source§impl Debug for MemoryRuntimeStreamAdapter
impl Debug for MemoryRuntimeStreamAdapter
Source§impl Default for MemoryRuntimeStreamAdapter
impl Default for MemoryRuntimeStreamAdapter
Source§fn default() -> MemoryRuntimeStreamAdapter
fn default() -> MemoryRuntimeStreamAdapter
Returns the “default value” for a type. Read more
Source§impl RuntimeStreamAdapter for MemoryRuntimeStreamAdapter
impl RuntimeStreamAdapter for MemoryRuntimeStreamAdapter
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,
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,
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.Auto Trait Implementations§
impl !Freeze for MemoryRuntimeStreamAdapter
impl !RefUnwindSafe for MemoryRuntimeStreamAdapter
impl Send for MemoryRuntimeStreamAdapter
impl Sync for MemoryRuntimeStreamAdapter
impl Unpin for MemoryRuntimeStreamAdapter
impl UnsafeUnpin for MemoryRuntimeStreamAdapter
impl UnwindSafe for MemoryRuntimeStreamAdapter
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more