Fix tests.
This commit is contained in:
parent
adb0c4ef3c
commit
b9fb1dab24
|
@ -20,3 +20,4 @@ serde_json = "1.0.59"
|
|||
|
||||
[dev-dependencies]
|
||||
tokio = { version = "1.0", default-features = false, features = ["macros", "rt-multi-thread", "time"] }
|
||||
async-stream = "0.3.0"
|
||||
|
|
|
@ -31,7 +31,13 @@ use warp::{Filter, Rejection, Reply};
|
|||
/// #[Subscription]
|
||||
/// impl SubscriptionRoot {
|
||||
/// async fn tick(&self) -> impl Stream<Item = String> {
|
||||
/// tokio::time::interval(Duration::from_secs(1)).map(|n| format!("{}", n.elapsed().as_secs_f32()))
|
||||
/// async_stream::stream! {
|
||||
/// let mut interval = tokio::time::interval(Duration::from_secs(1));
|
||||
/// loop {
|
||||
/// let n = interval.tick().await;
|
||||
/// yield format!("{}", n.elapsed().as_secs_f32());
|
||||
/// }
|
||||
/// }
|
||||
/// }
|
||||
/// }
|
||||
///
|
||||
|
|
Loading…
Reference in New Issue
Block a user