Skip to main content

shutdown_signal

Function shutdown_signal 

Source
pub async fn shutdown_signal()
Expand description

Waits for Ctrl+C (SIGINT), or on Unix, SIGTERM – so a service manager’s ordinary “stop” request (systemctl stop, launchctl stop) drains in-flight requests the same way an interactive Ctrl+C does, rather than dropping connections mid-response. The Windows Service Control Manager’s own Stop/Shutdown control codes don’t arrive as either of these signals – see crate::service::windows_impl::run_service for the SCM-specific equivalent used instead when running as a Windows service.