#async #futures #signal #tokio #web

bin+lib tokio-shutdown

Wait for a stop signal across multiple threads

4 releases

Uses new Rust 2021

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

#450 in Asynchronous

Download history 9/week @ 2022-06-10 40/week @ 2022-06-17 13/week @ 2022-06-24 58/week @ 2022-07-01 17/week @ 2022-07-08 33/week @ 2022-07-15 18/week @ 2022-07-22 33/week @ 2022-07-29 19/week @ 2022-08-05 61/week @ 2022-08-12 91/week @ 2022-08-19 30/week @ 2022-08-26 46/week @ 2022-09-02 54/week @ 2022-09-09 31/week @ 2022-09-16 12/week @ 2022-09-23

145 downloads per month

MIT license

10KB
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

~2.7–8MB
~127K SLoC