Tutorial by Examples

The chan-signal crate provides a solution to handle OS signal using channels, altough this crate is experimental and should be used carefully. Example taken from BurntSushi/chan-signal. #[macro_use] extern crate chan; extern crate chan_signal; use chan_signal::Signal; fn main() { // S...
The nix crate provides an UNIX Rust API to handle signals, however it requires using unsafe rust so you should be careful. use nix::sys::signal; extern fn handle_sigint(_:i32) { // Be careful here... } fn main() { let sig_action = signal::SigAction::new(handle_sigint, ...
The tokio-signal crate provides a tokio-based solution for handling signals. It's still in it's early stages though. extern crate futures; extern crate tokio_core; extern crate tokio_signal; use futures::{Future, Stream}; use tokio_core::reactor::Core use tokio_signal::unix::{self as unix_si...

Page 1 of 1