#future #async #web #tokio

bin+lib tokio-shutdown

Wait for a stop signal across multiple threads

6 releases

0.1.5 Dec 8, 2024
0.1.4 May 18, 2023
0.1.3 Aug 19, 2022
0.1.2 May 27, 2022
0.1.0 Feb 1, 2022

#1202 in Asynchronous

Download history 148/week @ 2026-01-22 266/week @ 2026-01-29 243/week @ 2026-02-05 251/week @ 2026-02-12 173/week @ 2026-02-19 139/week @ 2026-02-26 322/week @ 2026-03-05 178/week @ 2026-03-12 203/week @ 2026-03-19 240/week @ 2026-03-26 490/week @ 2026-04-02 422/week @ 2026-04-09 161/week @ 2026-04-16 90/week @ 2026-04-23 27/week @ 2026-04-30 124/week @ 2026-05-07

438 downloads per month
Used in 2 crates

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

~6–12MB
~128K SLoC