Registry / async / signal-hook-tokio

signal-hook-tokio

JSON →
library0.4.0rscratesunverified

Tokio support for signal-hook.

# Cargo.toml [dependencies] signal-hook-tokio = "0.4.0"
INSTALL
IMPORT
SIG · SIGNAL-HOOK-TOKIO
S
signal-hook-tokio
asyncrustv0.4.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Signals
use signal_hook_tokio::Signals;

Handle OS signals asynchronously with Tokio.

use signal_hook_tokio::Signals; use signal_hook::consts::SIGTERM; #[tokio::main] async fn main() { let signals = Signals::new(&[SIGTERM]).unwrap(); signals.handle().await; println!("Received SIGTERM"); }
Debug
Known issues
gotchaRequires Tokio runtime; not compatible with other async runtimes.
fix
Ensure you are using Tokio as the async executor.
affects: >=0.4.0
Upgrade
Version history
0.4.0latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
20 hits · last 30 days
node
18
OpenAI (training)
1
Resources
signal-hook-tokio — cargo add signal-hook-tokio · libregistry