Flowync

Crates.io Flowync documentation CI

Quick Example

```rust use flowync::Flower;

fn main() { let flower = Flower::::new(1); let handle = flower.handle(); std::thread::spawn(move || { handle.startflowing(); for i in 0..10 { handle.sendcurrent(i); // // Return error. // if i >= 3 { // return handle.err("Err".into()); // } } handle.ok("Ok".into()); });

let mut exit = false;

loop {
    flower.try_recv(
        |option| {
            if let Some(value) = option {
                println!("{}", value);
            }
        },
        |result| {
            match result {
                Ok(value) => {
                    println!("{}", value);
                }
                Err(e) => {
                    println!("{}", e);
                }
            }
            exit = true;
        },
    );

    if exit {
        break;
    }
}

} ```