1 unstable release

0.1.0 Feb 1, 2025

#432 in Unix APIs

Download history 99/week @ 2025-01-28 19/week @ 2025-02-04 19/week @ 2025-02-11

137 downloads per month

MIT license

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 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

~6–12MB
~125K SLoC