weighted-select

Crates.ioweighted-select
lib.rsweighted-select
version0.1.1
sourcesrc
created_at2019-04-13 13:01:42.126778
updated_at2019-04-13 13:10:17.421473
descriptionfutures::stream::Select with weights
homepage
repositoryhttps://github.com/loyd/weighted-select
max_upload_size
id127652
size10,770
Paul Loyd (loyd)

documentation

https://docs.rs/weighted-select/

README

weighted-select

Usage:

use weighted_select::{self, IncompleteSelect};

let select = weighted_select::new()
    .append(fetch_from_a, 5)
    .append(fetch_from_b, 2)
    .append(fetch_from_c, 3)
    .build();

It produces a stream that combines three underlying streams (fetch_from_*) and polls them according to their weights (5, 2, 3). Each stream will be polled at most weight times consecutively.

Commit count: 5

cargo fmt