pub struct LifecycleSubscription { /* private fields */ }Expand description
A bounded subscription that reports every event it had to discard.
Implementations§
Source§impl LifecycleSubscription
impl LifecycleSubscription
Sourcepub fn recv_timeout(
&self,
timeout: Duration,
) -> Result<LifecycleEvent, EventReceiveError>
pub fn recv_timeout( &self, timeout: Duration, ) -> Result<LifecycleEvent, EventReceiveError>
Waits up to timeout for the next retained event.
§Errors
Returns a typed timeout, closure, or synchronization failure.
Sourcepub fn try_recv(&self) -> Result<LifecycleEvent, EventTryReceiveError>
pub fn try_recv(&self) -> Result<LifecycleEvent, EventTryReceiveError>
Returns the next retained event without waiting.
§Errors
Returns closure, emptiness, or synchronization failures distinctly.
Sourcepub fn recv(&self) -> Result<LifecycleEvent, EventReceiveError>
pub fn recv(&self) -> Result<LifecycleEvent, EventReceiveError>
Blocks until the next retained event arrives or the subscription is
closed — the timeout-less sibling of Self::recv_timeout, same
condvar, no timer anywhere (Ruling B’s sanctioned blocking shape:
close is the only external wake, delivered by
SubscriptionCloseHandle::close or this subscription’s drop).
§Errors
Returns a typed closure or synchronization failure; never a timeout.
Sourcepub fn lagged_events(&self) -> usize
pub fn lagged_events(&self) -> usize
Returns the cumulative number of events dropped from this subscriber.
Sourcepub fn close_handle(&self) -> SubscriptionCloseHandle
pub fn close_handle(&self) -> SubscriptionCloseHandle
Returns a handle that closes this subscription from another thread, waking every blocked receiver (the demand-driven teardown wake — the F-6a frame-core sanction amendment).
The handle holds only a weak reference: retaining it never keeps the subscription’s queue alive after the subscription drops.