llam 0.1.2

Safe, Go-style Rust bindings for the LLAM runtime
use std::time::Duration;

fn main() -> llam::Result<()> {
    llam::run(|| {
        let (tx, rx) = llam::channel::bounded::<u64>(16)?;

        for i in 0..4 {
            let tx = tx.clone();
            llam::spawn!(move {
                tx.send(i * 2).expect("send failed");
            });
        }
        drop(tx);

        let mut sum = 0;
        while let Ok(value) = rx.recv_timeout(Duration::from_millis(50)) {
            sum += value;
        }

        println!("LLAM-rs sum={sum}");
        Ok(())
    })
}