pub struct SubscriptionHandle { /* private fields */ }Expand description
Handle returned by channel subscriptions for receiving validated envelopes.
Owns the subscriber’s beamr pid, the shared inbox, and a clone of the scheduler so the process can be terminated when the subscription ends. The handle is the subscription’s lifetime: dropping the last clone terminates the subscriber process, whose EXIT prunes the channel actor’s fan-out list.
Implementations§
Source§impl SubscriptionHandle
impl SubscriptionHandle
Sourcepub fn try_next(&self) -> Result<Option<Envelope>, LiminalError>
pub fn try_next(&self) -> Result<Option<Envelope>, LiminalError>
Attempts to receive the next delivered envelope without blocking.
§Errors
Returns LiminalError::SubscriptionFailed when the subscription inbox cannot be read.
Sourcepub fn subscriber_pid(&self) -> u64
pub fn subscriber_pid(&self) -> u64
The subscriber process’s pid: the id
ChannelHandle::publish_recording
records for this subscription, and the one a
ClusterObserver hears it by.
Sourcepub fn has_pending(&self) -> bool
pub fn has_pending(&self) -> bool
Whether an envelope is available without consuming it.
Sourcepub fn is_overflowed(&self) -> bool
pub fn is_overflowed(&self) -> bool
Whether an overflow has marked this subscription for shedding (§5).