ert

Crates.ioert
lib.rsert
version0.2.2
sourcesrc
created_at2019-09-29 22:07:17.746524
updated_at2020-09-01 05:49:26.260919
descriptionA combinator to control future execution order.
homepage
repositoryhttps://github.com/YushiOMOTE/ert
max_upload_size
id168695
size29,416
Yushi OMOTE (YushiOMOTE)

documentation

README

ert

A combinator to control future execution order.

Latest version Documentation License Actions Status

struct Data {
    file: String,
    tag: usize,
    value: usize,
}

#[tokio::main]
async fn main() {
    // Stream of `Data` coming over TCP.
    let f = tcp_stream()
        .map(|d| {
            let tag = d.tag;
            let f = async move {
                let v = read_value_from_file(&d.file).await;
                write_value_to_file(&d.file, v + d.value).await;
            };
            f.via_g(tag)
        })
        .buffer_unordered(100)
        .for_each(|_| async {});

    f.await;
}

order

Commit count: 26

cargo fmt