2 unstable releases

new 0.2.0 Mar 3, 2025
0.1.0 Feb 1, 2025

#443 in Unix APIs

Download history 114/week @ 2025-02-01 18/week @ 2025-02-08 14/week @ 2025-02-15 117/week @ 2025-03-01

152 downloads per month

MIT license

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 handling
  • wait_for_signal_timeout(): Signal handling with timeout
  • graceful_shutdown(): Managed shutdown with timeout and optional force exit
  • UnixSignalConfig: 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