doublecross

Crates.iodoublecross
lib.rsdoublecross
version0.2.1
sourcesrc
created_at2018-09-21 21:53:51.813646
updated_at2018-09-21 23:09:40.807259
descriptionBi-directional channels for rust based on crossbeam-channel
homepagehttps://github.com/oefd/doublecross
repositoryhttps://github.com/oefd/doublecross
max_upload_size
id85884
size24,933
Terry (oefd)

documentation

README

doublecross

Build Status License Cargo Documentation

Bi-directional channels for communicating between threads based on crossbeam-channel.

example

let (left, right) = unbounded::<bool, i32>();
thread::spawn(move || {
    loop {
        let val = right.recv().unwrap();
        right.send(val % 2 == 0);
    }
});

for i in 0..10 {
    left.send(i);
    if left.recv().unwrap() {
        println!("{} is even", i);
    }
}

usage

[dependencies]
doublecross = "0.2"

license

Licensed under the terms of of the MPL-2.0.

Commit count: 8

cargo fmt