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

#195 in Concurrency

Download history 80/week @ 2021-06-30 61/week @ 2021-07-07 87/week @ 2021-07-14 94/week @ 2021-07-21 255/week @ 2021-07-28 63/week @ 2021-08-04 125/week @ 2021-08-11 111/week @ 2021-08-18 98/week @ 2021-08-25 199/week @ 2021-09-01 122/week @ 2021-09-08 77/week @ 2021-09-15 47/week @ 2021-09-22 55/week @ 2021-09-29 46/week @ 2021-10-06 209/week @ 2021-10-13

363 downloads per month
Used in 2 crates

Custom license

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

~42KB