2 unstable releases
new 0.2.0 | Mar 3, 2025 |
---|---|
0.1.0 | Feb 1, 2025 |
#443 in Unix APIs
152 downloads per month
15KB
315 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
~5–12MB
~125K SLoC