clone-stream 0.4.1

Turn any Stream into a cloneable stream where each clone receives all items independently.
Documentation
1
2
3
4
5
6
7
8
#![allow(dead_code)]
use std::{future::Future, time::Duration};

use tokio::time::{Instant, sleep_until};

pub fn until(start: Instant, n: usize) -> impl Future<Output = ()> {
    sleep_until(start + Duration::from_millis(10) * n as u32)
}