pub struct StreamSubscription { /* private fields */ }Implementations§
Source§impl StreamSubscription
impl StreamSubscription
pub fn name(&self) -> &str
Sourcepub fn is_running(&self) -> bool
pub fn is_running(&self) -> bool
Returns true until StreamSubscription::close has been invoked
(or the subscription was dropped). Useful for control planes that
need to skip already-shutdown subscriptions without racing on close.
pub async fn close(&self) -> Result<(), EventBusError>
Sourcepub async fn abort(&self) -> Result<(), EventBusError>
pub async fn abort(&self) -> Result<(), EventBusError>
Abort the background task without waiting for graceful drain. Returns
Ok(()) if the abort was acknowledged or the task was already done;
surfaces the task’s last error if it had one.
Trait Implementations§
Source§impl Drop for StreamSubscription
Dropping a StreamSubscription is fire-and-forget: it signals the
background task to exit but does not await it, and delivery errors
raised after the close signal are silently discarded. To surface those
errors, call StreamSubscription::close explicitly and await the
returned Result.
impl Drop for StreamSubscription
Dropping a StreamSubscription is fire-and-forget: it signals the
background task to exit but does not await it, and delivery errors
raised after the close signal are silently discarded. To surface those
errors, call StreamSubscription::close explicitly and await the
returned Result.
When the subscription is dropped without close() having been called,
the configured ErrorObserver (if any) is notified via
ErrorScope::Drop so leaked subscriptions are observable.