#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

#602 in Operating systems

Download history 273/week @ 2023-12-01 158/week @ 2023-12-08 378/week @ 2023-12-15 805/week @ 2023-12-22 99/week @ 2023-12-29 461/week @ 2024-01-05 110/week @ 2024-01-12 346/week @ 2024-01-19 230/week @ 2024-01-26 412/week @ 2024-02-02 127/week @ 2024-02-09 271/week @ 2024-02-16 194/week @ 2024-02-23 251/week @ 2024-03-01 354/week @ 2024-03-08 219/week @ 2024-03-15

1,128 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