#signal #tokio #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

#484 in Asynchronous

Download history 46/week @ 2024-01-07 85/week @ 2024-01-14 40/week @ 2024-01-21 47/week @ 2024-01-28 86/week @ 2024-02-04 37/week @ 2024-02-11 40/week @ 2024-02-18 127/week @ 2024-02-25 89/week @ 2024-03-03 64/week @ 2024-03-10 154/week @ 2024-03-17 129/week @ 2024-03-24 69/week @ 2024-03-31 178/week @ 2024-04-07 139/week @ 2024-04-14 115/week @ 2024-04-21

513 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–15MB
~133K SLoC