diff options
author | Ferris Tseng <ferristseng@fastmail.fm> | 2021-02-08 23:18:07 -0500 |
---|---|---|
committer | Ferris Tseng <ferristseng@fastmail.fm> | 2021-02-08 23:18:07 -0500 |
commit | 2a9038d11a6e286c70e2ed28b3ee8d2564877538 (patch) | |
tree | 9b4f77973da9db92e6777fdac8e9a155ee46a131 | |
parent | 129f884c511babbb41be3acfb247a075d1ba679f (diff) |
upgrade tokio
-rw-r--r-- | ipfs-api/examples/pubsub.rs | 4 |
1 files changed, 3 insertions, 1 deletions
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!(); |