#shutdown-signal #shutdown #axum #graceful-shutdown #dead

vss

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

2 releases

0.1.1 Nov 26, 2024
0.1.0 Dec 29, 2023

#456 in Asynchronous

Download history 139/week @ 2024-08-26 58/week @ 2024-09-02 23/week @ 2024-09-09 37/week @ 2024-09-16 67/week @ 2024-09-23 73/week @ 2024-09-30 38/week @ 2024-10-07 117/week @ 2024-10-14 214/week @ 2024-10-21 173/week @ 2024-10-28 140/week @ 2024-11-04 89/week @ 2024-11-11 144/week @ 2024-11-18 362/week @ 2024-11-25 111/week @ 2024-12-02 84/week @ 2024-12-09

709 downloads per month
Used in tunnelbana

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
~106K SLoC