halt 0.5.1

Provides functionality for pausing, stopping, and resuming iterators, readers, and writers.

nyx

Travis Crates.io Docs

Provides functionality for pausing, stopping, and resuming iterators, readers, and writers.

Examples

Add this to Cargo.toml:

[dependencies]
halt = "0.5"

And this to main.rs:

use std::{io, thread, time::Duration};

fn main() {
    let mut halt = halt::new(io::repeat(0));
    let remote = halt.remote();
    thread::spawn(move || io::copy(&mut halt, &mut io::sink()).unwrap());
    thread::sleep(Duration::from_secs(5));
    remote.pause();
    thread::sleep(Duration::from_secs(5));
    remote.resume();
}

License

Licensed under either of

at your option.

Contribution

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