Alex Crichton 7ab97f99c8 signal: Clarify wording of license information in README.
This text historically was copied verbatim from rust-lang/rust's own README [1]
with the intention of licensing projects the same as rustc's own license, namely
a dual MIT/Apache-2.0 license. The clause about "various BSD-like licenses"
isn't actually correct for almost all projects other than rust-lang/rust and
the wording around "both" was slightly ambiguous.

This commit updates the wording to match more precisely what's in the
standard library [2], namely clarifying that there aren't any BSD-like licenses
in this repository and that the source is licensable under either license, at
your own discretion.

[1]: f0fe716dbc (license)
[2]: f0fe716dbc/src/libstd/lib.rs (L5-L9)
2018-09-10 11:30:01 -07:00
2018-09-10 11:29:50 -07:00
2018-09-10 11:29:59 -07:00
2018-09-10 11:29:50 -07:00
2018-09-10 11:29:50 -07:00

tokio-signal

An implementation of Unix signal handling for Tokio

Build Status

Documentation

Usage

First, add this to your Cargo.toml:

[dependencies]
tokio-signal = "0.1"

Next you can use this in conjunction with the tokio-core and futures crates:

extern crate futures;
extern crate tokio_core;
extern crate tokio_signal;

use tokio_core::reactor::Core;
use futures::{Future, Stream};

fn main() {
    let mut core = Core::new().unwrap();
    let handle = core.handle();

    // Create an infinite stream of "Ctrl+C" notifications. Each item received
    // on this stream may represent multiple ctrl-c signals.
    let ctrl_c = tokio_signal::ctrl_c(&handle).flatten_stream();

    // Process each ctrl-c as it comes in
    let prog = ctrl_c.for_each(|()| {
        println!("ctrl-c received!");
        Ok(())
    });

    core.run(prog).unwrap();
}

License

This project is licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in Serde by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Description
A runtime for writing reliable asynchronous applications with Rust. Provides I/O, networking, scheduling, timers, ...
Readme MIT 75 MiB
Languages
Rust 100%