ruchei 0.1.2

Utilities for working with many streams
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
//! [`ruchei::compress`]

use std::time::Duration;

use async_std::stream::StreamExt;
use ruchei::compress::{CompressExt, Credit};

#[async_std::main]
async fn main() {
    let inner = async_io::Timer::interval(Duration::from_secs(1));
    let credits = async_io::Timer::interval(Duration::from_secs_f64(1.0 + 5.0f64.sqrt()));
    inner
        .map(|_| vec![0])
        .compress(credits.map(|_| Credit))
        .for_each(|vec| println!("{vec:?}"))
        .await;
}