From 2a9038d11a6e286c70e2ed28b3ee8d2564877538 Mon Sep 17 00:00:00 2001 From: Ferris Tseng Date: Mon, 8 Feb 2021 23:18:07 -0500 Subject: upgrade tokio --- ipfs-api/examples/pubsub.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ipfs-api/examples/pubsub.rs b/ipfs-api/examples/pubsub.rs index 6fef446..baa1b1b 100644 --- a/ipfs-api/examples/pubsub.rs +++ b/ipfs-api/examples/pubsub.rs @@ -13,6 +13,7 @@ use futures::{future, FutureExt, StreamExt, TryStreamExt}; use ipfs_api::IpfsClient; use std::time::Duration; use tokio::time; +use tokio_stream::wrappers::IntervalStream; static TOPIC: &'static str = "test"; @@ -35,7 +36,8 @@ async fn main() { // This block will execute a repeating function that sends // a message to the "test" topic. // - let mut publish = time::interval(Duration::from_secs(1)) + let interval = time::interval(Duration::from_secs(1)); + let mut publish = IntervalStream::new(interval) .then(|_| future::ok(())) // Coerce the stream into a TryStream .try_for_each(|_| { eprintln!(); -- cgit v1.2.3