Skip to main content

install_signal_handler

Function install_signal_handler 

Source
pub fn install_signal_handler() -> CancellationToken
Expand description

Wait for SIGTERM or SIGINT, then trigger shutdown.

Call this once at application startup. It spawns a background task that waits for the OS signal, then cancels the global token.

Returns the token for use in tokio::select! or other async shutdown coordination.