opentelemetry_sdk/
util.rs

1//! Internal utilities
2
3/// Helper which wraps `tokio::time::interval` and makes it return a stream
4#[cfg(any(feature = "rt-tokio", feature = "rt-tokio-current-thread"))]
5pub fn tokio_interval_stream(
6    period: std::time::Duration,
7) -> tokio_stream::wrappers::IntervalStream {
8    tokio_stream::wrappers::IntervalStream::new(tokio::time::interval(period))
9}