#tokio #windows #tokio-runtime #sigusr2

xext-tokio

Extended utilities for tokio runtime

2 unstable releases

0.2.0 Mar 3, 2025
0.1.0 Feb 1, 2025

#529 in Asynchronous

Download history 55/week @ 2025-01-26 61/week @ 2025-02-02 17/week @ 2025-02-09 13/week @ 2025-02-16 129/week @ 2025-03-02 9/week @ 2025-03-09

138 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