1 unstable release
0.1.0 | Feb 1, 2025 |
---|
#432 in Unix APIs
137 downloads per month
14KB
272 lines
xext-tokio
A Rust library providing extended utilities for Tokio, focusing on signal handling and graceful shutdown capabilities.
Features
- Cross-platform signal handling (Unix and Windows)
- Configurable signal handling with timeout support
- Graceful shutdown with customizable timeout and force exit options
- Comprehensive Unix signal support (SIGTERM, SIGINT, SIGHUP, SIGUSR1, SIGUSR2)
Installation
Add this to your Cargo.toml
:
[dependencies]
xext-tokio = "0.1.0"
Platform Support
- Unix: Supports SIGTERM, SIGINT, SIGHUP, SIGUSR1, SIGUSR2
- Windows: Supports Ctrl+C, Ctrl+Break, Ctrl+Close, and Ctrl+Shutdown events
Features
wait_for_signal()
: Basic signal handlingwait_for_signal_timeout()
: Signal handling with timeoutgraceful_shutdown()
: Managed shutdown with timeout and optional force exitUnixSignalConfig
: Configurable Unix signal handling- Built-in logging with tracing
License
This project is licensed under the MIT License.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Dependencies
~6–12MB
~125K SLoC