#tokio #signal #async #future #web #graceful-shutdown

bin+lib tokio-shutdown

Wait for a stop signal across multiple threads

5 releases

0.1.4 May 18, 2023
0.1.3 Aug 19, 2022
0.1.2 May 27, 2022
0.1.1 May 26, 2022
0.1.0 Feb 1, 2022

#763 in Asynchronous

Download history 329/week @ 2024-07-27 230/week @ 2024-08-03 223/week @ 2024-08-10 227/week @ 2024-08-17 271/week @ 2024-08-24 199/week @ 2024-08-31 145/week @ 2024-09-07 221/week @ 2024-09-14 306/week @ 2024-09-21 300/week @ 2024-09-28 192/week @ 2024-10-05 116/week @ 2024-10-12 195/week @ 2024-10-19 142/week @ 2024-10-26 172/week @ 2024-11-02 135/week @ 2024-11-09

660 downloads per month
Used in wazzup

MIT license

11KB
88 lines

Tokio Shutdown

Build Status Repository Documentation

Tiny crate that allows to wait for a stop signal across multiple threads. Helpful mostly in server applications that run indefinitely and need a signal for graceful shutdowns.

Usage

Add tokio-shutdown to your project with cargo add tokio-shutdown (needs cargo-edit) or add it manually to your Cargo.toml:

[dependencies]
tokio-shutdown = "<latest-version>"

In addition, you will need to use the lastest tokio runtime to use this library, as it uses async/await and is bound to this runtime.

Example

For examples check out the basic and streaming, or consult the docs.

License

This project is licensed under MIT License (or http://opensource.org/licenses/MIT).

Dependencies

~3–11MB
~113K SLoC