Skip to main content

cancel_token

Function cancel_token 

Source
pub fn cancel_token() -> &'static CancellationToken
Expand description

Returns the process-wide cancellation token for async graceful shutdown.

The token is cancelled by the signal handler alongside SHUTDOWN. Async loops should use token.cancelled().await inside tokio::select! for instant wake-up instead of polling shutdown_requested.