pub async fn smooth_stream<S>(
    input: S,
    max_interval: Duration
) -> impl Stream<Item = S::Item>where
    S: Stream + Unpin + Send + 'static,
    S::Item: Send,