#signal #channel

signal-notify

Catch OS signals with standard mpsc channel

4 releases

Uses old Rust 2015

0.1.3 Dec 16, 2017
0.1.2 Jul 1, 2017
0.1.1 Jul 1, 2017
0.1.0 Jul 1, 2017

#759 in Operating systems

Download history 26/week @ 2024-11-13 27/week @ 2024-11-20 23/week @ 2024-11-27 29/week @ 2024-12-04 56/week @ 2024-12-11 66/week @ 2024-12-18 32/week @ 2024-12-25 5/week @ 2025-01-08 68/week @ 2025-01-15 39/week @ 2025-01-22 21/week @ 2025-02-05 50/week @ 2025-02-12 16/week @ 2025-02-19 21/week @ 2025-02-26

108 downloads per month
Used in 2 crates

Custom license

9KB
204 lines

signal-notify crate provides a simple way to wait for signals in *nix systems through standard std::sync::mpsc API.

Build Status

use signal_notify::{notify, Signal};

let rx = notify(&[Signal::INT, Signal::HUP]);
// block unitl receiving SIGINT or SIGHUP.
// recv always return Ok because the sender channel will be never closed.
rx.recv().unwrap()

signal-notify doesn't support Windows. I'm not familiar with Windows, so I'd be happy if you could help me about it.


lib.rs:

signal-notify crate provides a simple way to wait for signals in *nix systems through standard std::sync::mpsc API.

use signal_notify::{notify, Signal};

let rx = notify(&[Signal::INT, Signal::HUP]);
// block unitl receiving SIGINT or SIGHUP.
// recv always return Ok because the sender channel will be never closed.
rx.recv().unwrap();

signal-notify doesn't support Windows. I'm not familiar with Windows, so I'd be happy if you could help me about it.

Dependencies

~52KB