stream_throttle
Provides a
Rust
Stream
combinator, to limit the rate at which items are produced.
Key Features
- Throttling is implemented via
poll(), and not via any sort of buffering. - The throttling behaviour can be applied to both
Stream's andFuture's. - Multiple streams/futures can be throttled together as a group.
Example throttling of Stream
let rate = new;
let pool = new;
let work = repeat
.throttle
.for_each;
run;
Example throttling of Future
let rate = new;
let pool = new;
pool.queue
.then;
run;