#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

#723 in Operating systems

Download history 35/week @ 2024-07-24 38/week @ 2024-07-31 48/week @ 2024-08-07 35/week @ 2024-08-14 8/week @ 2024-08-21 14/week @ 2024-08-28 16/week @ 2024-09-04 27/week @ 2024-09-11 28/week @ 2024-09-18 30/week @ 2024-09-25 28/week @ 2024-10-02 38/week @ 2024-10-09 31/week @ 2024-10-16 18/week @ 2024-10-23 14/week @ 2024-10-30 24/week @ 2024-11-06

105 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

~53KB