pub struct ShutdownCoordinator { /* private fields */ }Expand description
Coordinates shutdown across all endpoint components
Implementations§
Source§impl ShutdownCoordinator
impl ShutdownCoordinator
Sourcepub fn close_start_token(&self) -> CancellationToken
pub fn close_start_token(&self) -> CancellationToken
Get a token that is cancelled when shutdown starts
Sourcepub fn close_complete_token(&self) -> CancellationToken
pub fn close_complete_token(&self) -> CancellationToken
Get a token that is cancelled when shutdown completes
Sourcepub fn is_shutting_down(&self) -> bool
pub fn is_shutting_down(&self) -> bool
Check if shutdown has been initiated
Sourcepub fn register_task(&self, handle: JoinHandle<()>)
pub fn register_task(&self, handle: JoinHandle<()>)
Register a background task for tracking
Sourcepub fn spawn_tracked<F>(self: &Arc<Self>, future: F) -> JoinHandle<()>
pub fn spawn_tracked<F>(self: &Arc<Self>, future: F) -> JoinHandle<()>
Spawn a tracked task that respects the shutdown token
Sourcepub fn active_task_count(&self) -> usize
pub fn active_task_count(&self) -> usize
Get count of active tasks
Trait Implementations§
Source§impl Debug for ShutdownCoordinator
impl Debug for ShutdownCoordinator
Auto Trait Implementations§
impl !Freeze for ShutdownCoordinator
impl RefUnwindSafe for ShutdownCoordinator
impl Send for ShutdownCoordinator
impl Sync for ShutdownCoordinator
impl Unpin for ShutdownCoordinator
impl UnwindSafe for ShutdownCoordinator
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