#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

#615 in Operating systems

Download history 99/week @ 2024-01-01 463/week @ 2024-01-08 225/week @ 2024-01-15 285/week @ 2024-01-22 216/week @ 2024-01-29 375/week @ 2024-02-05 125/week @ 2024-02-12 277/week @ 2024-02-19 210/week @ 2024-02-26 309/week @ 2024-03-04 307/week @ 2024-03-11 211/week @ 2024-03-18 337/week @ 2024-03-25 306/week @ 2024-04-01 181/week @ 2024-04-08 112/week @ 2024-04-15

939 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

~59KB