From 782dd2f5222bfef5e12aa576a821da21126505b7 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Wed, 25 Nov 2020 03:06:24 +0100 Subject: Introduce `tokio_old` feature This feature allows users to rely on the `0.2` version of `tokio` while the async ecosystem upgrades to the latest version. --- futures/src/time.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'futures/src/time.rs') diff --git a/futures/src/time.rs b/futures/src/time.rs index e87b4a83..ec007d88 100644 --- a/futures/src/time.rs +++ b/futures/src/time.rs @@ -41,7 +41,10 @@ where } } -#[cfg(all(feature = "tokio", not(feature = "async-std")))] +#[cfg(all( + any(feature = "tokio", feature = "tokio_old"), + not(feature = "async-std") +))] impl subscription::Recipe for Every where H: std::hash::Hasher, @@ -61,6 +64,9 @@ where ) -> futures::stream::BoxStream<'static, Self::Output> { use futures::stream::StreamExt; + #[cfg(feature = "tokio_old")] + use tokio_old as tokio; + let start = tokio::time::Instant::now() + self.0; tokio::time::interval_at(start, self.0) -- cgit