From 154644880021950268e523c17f46dc6de50ef6a1 Mon Sep 17 00:00:00 2001 From: Yoshua Wuyts Date: Thu, 14 Nov 2019 21:27:14 +0100 Subject: [PATCH] remove throttle example Signed-off-by: Yoshua Wuyts --- examples/throttle.rs | 27 --------------------------- 1 file changed, 27 deletions(-) delete mode 100644 examples/throttle.rs diff --git a/examples/throttle.rs b/examples/throttle.rs deleted file mode 100644 index 74c1fd3..0000000 --- a/examples/throttle.rs +++ /dev/null @@ -1,27 +0,0 @@ -//! Spawns a timed task which gets throttled. - -fn main() { - #[cfg(feature = "unstable")] - { - use async_std::prelude::*; - use async_std::task; - - task::block_on(async { - use async_std::stream; - use std::time::Duration; - - // emit value every 1 second - let s = stream::interval(Duration::from_secs(1)).enumerate(); - - // throttle for 2 seconds - let s = s.throttle(Duration::from_secs(2)); - - s.for_each(|(n, _)| { - dbg!(n); - }) - .await; - // => 0 .. 1 .. 2 .. 3 - // with a pause of 2 seconds between each print - }) - } -}