1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
use Duration;
// use super::JoinHandle;
// pub struct JoinHandleAsyncStd<T> {
// inner: Option<async_std::task::JoinHandle<T>>,
// }
// unsafe impl<T: Send> Send for JoinHandleAsyncStd<T> {}
// unsafe impl<T: Send> Sync for JoinHandleAsyncStd<T> {}
// impl<T: Send + 'static> JoinHandle for JoinHandleAsyncStd<T> {
// fn cancel(&mut self) {
// if let Some(handle) = self.inner.take() {
// async_std::task::spawn(async move { handle.cancel().await });
// }
// }
// }
pub async
// pub fn interval(duration: Duration) -> impl Stream<Item = ()> {
// async_std::stream::interval(duration)
// }
// pub fn spawn<F>(future: F) -> impl JoinHandle
// where
// F: Future + Send + 'static,
// F::Output: Send + 'static,
// {
// let handle = async_std::task::spawn(future);
// JoinHandleAsyncStd {
// inner: Some(handle),
// }
// }