noir-compute 0.2.0

Network of Operators In Rust
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use noir_compute::prelude::*;

fn main() {
    let (config, _args) = RuntimeConfig::from_args();
    config.spawn_remote_workers();
    let env = StreamContext::new(config);

    let source = IteratorSource::new(0..100);
    let result = env
        .stream(source)
        .group_by(|i| i % 5)
        .fold(Vec::new(), Vec::push)
        .collect_vec();
    env.execute_blocking();
    if let Some(result) = result.get() {
        println!("{result:?}");
    }
}