pub struct SessionStreamBus { /* private fields */ }Implementations§
Source§impl SessionStreamBus
impl SessionStreamBus
pub fn new(capacity: usize) -> Self
pub fn subscribe(&self, session_id: &str) -> Receiver<Envelope>
pub fn publish(&self, session_id: &str, envelope: Envelope)
Sourcepub fn remove_if_unused(&self, session_id: &str) -> bool
pub fn remove_if_unused(&self, session_id: &str) -> bool
Remove a session’s broadcast channel if it has no live receivers.
Channels are created lazily on subscribe and were previously never
removed — every session ever streamed pinned a map entry (and a
lagging receiver pins up to capacity buffered envelopes) for the
process lifetime. Called from session eviction; a channel with active
receivers is left in place (false) and retried on the next sweep.
Sourcepub fn channel_count(&self) -> usize
pub fn channel_count(&self) -> usize
Number of live channels (observability / tests).
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for SessionStreamBus
impl RefUnwindSafe for SessionStreamBus
impl Send for SessionStreamBus
impl Sync for SessionStreamBus
impl Unpin for SessionStreamBus
impl UnsafeUnpin for SessionStreamBus
impl UnwindSafe for SessionStreamBus
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request