[][src]Crate bondi

Bondi

This is built to provide an inter-process mechanism to communicate between different parties.

It allows a Writer send a message that can be read by multiple Reader s concurrently. The role of Bondi is to sync these operations, while keeping things fast.

A Simple example

// initialize a writer and two readers
// send 100 `Message`s, and receive them from different threads
struct Message(usize)

fn main() {
    let bondi = Bondi::<Message>::new(100);
    let writer = bondi.get_tx().unwrap();
    let reader = bondi.get_rx().unwrap();
    let reader2 = bondi.get_rx().unwrap();

    std::thread::spawn(move || {
        for i in 0..100 {
            writer.write(Message(i));
        }
    });

    std::thread::spawn(move || {
        for i in 0..100 {
            reader.read().unwrap();
        }
    });

    std::thread::spawn(move || {
        for i in 0..100 {
            reader2.read().unwrap();
        }
    }).join().unwrap();
}

Modules

errors
reader
ring
writer

Structs

Bondi