#tokio #signal #async #future #web

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

#534 in Asynchronous

Download history 44/week @ 2023-11-20 26/week @ 2023-11-27 31/week @ 2023-12-04 47/week @ 2023-12-11 111/week @ 2023-12-18 78/week @ 2023-12-25 121/week @ 2024-01-01 41/week @ 2024-01-08 82/week @ 2024-01-15 40/week @ 2024-01-22 47/week @ 2024-01-29 93/week @ 2024-02-05 30/week @ 2024-02-12 41/week @ 2024-02-19 129/week @ 2024-02-26 90/week @ 2024-03-04

297 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–14MB
~132K SLoC