shutdown
shutdown can be used to gracefully exit (part of) a running program
Example
The example below shows how to create a new shutdown signal, create a few branches, subscribe some listeners and signal one of the branches:
use Shutdown;
Usage
Add shutdown and Tokio to your dependencies:
= "0.3"
= { = "1", = ["full"] }
And then get started in your main.rs
:
use Shutdown;
use ;
async
Running the tests
Because each "root" shutdown signal registers itself to listen for SIGINT and SIGTERM signals, the test need to run one by one. So to run the tests, please execute:
Contributions
Pull requests and issues are always welcome and appreciated!
License
shutdown is distributed under the terms of both the MIT license and the Apache License (Version 2.0)
- Apache License 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT License (LICENSE-MIT or http://opensource.org/licenses/MIT)