Skip to main content

register_shutdown_handler

Function register_shutdown_handler 

Source
pub fn register_shutdown_handler()
Expand description

Registers the global shutdown handler for Ctrl+C / SIGTERM / SIGHUP.

First signal: sets SHUTDOWN flag, cancels the global cancellation token, logs graceful shutdown intent.

Second signal: calls [std::process::exit(130)] for immediate termination following Unix convention (128 + SIGINT=2).