Skip to main content

shutdown_signal

Function shutdown_signal 

Source
pub async fn shutdown_signal()
Expand description

Future that resolves when the process receives a shutdown signal.

On Unix this listens for both SIGINT (Ctrl+C) and SIGTERM. On other platforms only SIGINT is supported.

§Usage

axum::serve(listener, router)
    .with_graceful_shutdown(atrg_core::shutdown_signal())
    .await?;