#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

#673 in Operating systems

Download history 306/week @ 2024-04-01 181/week @ 2024-04-08 112/week @ 2024-04-15 34/week @ 2024-04-22 75/week @ 2024-04-29 271/week @ 2024-05-06 112/week @ 2024-05-13 75/week @ 2024-05-20 20/week @ 2024-05-27 16/week @ 2024-06-03 40/week @ 2024-06-10 23/week @ 2024-06-17 40/week @ 2024-06-24 4/week @ 2024-07-01 17/week @ 2024-07-08 21/week @ 2024-07-15

83 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