https://github.com/halfzebra/tokio-graceful-shutdown-example
Graceful shutdown example for UNIX signals
https://github.com/halfzebra/tokio-graceful-shutdown-example
graceful-shutdown rust signal-processing tokio
Last synced: 7 months ago
JSON representation
Graceful shutdown example for UNIX signals
- Host: GitHub
- URL: https://github.com/halfzebra/tokio-graceful-shutdown-example
- Owner: halfzebra
- Created: 2022-02-08T11:36:56.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-02-08T11:40:15.000Z (over 3 years ago)
- Last Synced: 2025-01-20T10:14:04.072Z (9 months ago)
- Topics: graceful-shutdown, rust, signal-processing, tokio
- Language: Rust
- Homepage:
- Size: 2.93 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# tokio-graceful-shutdown-example
This repo contains a UNIX-friendly example of implementing graceful shutdown for programs using [tokio.](https://tokio.rs/), which run [tokio::process::Command.](https://docs.rs/tokio/latest/tokio/process/struct.Command.html)
It's also possible to use [futures::select](https://docs.rs/futures/latest/futures/macro.select.html) for a cleaner code style with [select!](https://docs.rs/futures/latest/futures/macro.select.html) macro.
## Running locally
```
cargo run
# Ctrl + C for SIGINT
# Ctrl + \ for SIGQUIT
```