#shutdown #shutdown-signal #graceful-shutdown

vss

A dead simple library to allow for easily reused shutdown signal handling

1 unstable release

0.1.0 Dec 29, 2023

#1485 in Asynchronous

Download history 31/week @ 2024-07-21 67/week @ 2024-07-28 28/week @ 2024-08-04 104/week @ 2024-08-11 78/week @ 2024-08-18 87/week @ 2024-08-25 106/week @ 2024-09-01 27/week @ 2024-09-08 34/week @ 2024-09-15 66/week @ 2024-09-22 75/week @ 2024-09-29 29/week @ 2024-10-06 102/week @ 2024-10-13 228/week @ 2024-10-20 170/week @ 2024-10-27 97/week @ 2024-11-03

607 downloads per month

MIT/Apache

4KB

vss

valkyrie_pilot's shutdown_signal

This is a very simple crate, made to be used with axum's graceful_shutdown method, like so:

#[tokio::main]
async fn main() {
axum::serve(tcp, app)
    .with_graceful_shutdown(vss::shutdown_signal())
    .await
    .unwrap();
}

lib.rs:

valkyrie_pilot's shutdown signal

This crate provides a simple, cross-platform Tokio shutdown waiter.

Made because docker sends sigquit, but tokio's ctrl_c does not respond to sigquit, leading to the container being killed 10s later.

Dependencies

~3–11MB
~110K SLoC