|
@ -6,11 +6,15 @@ use std::{ |
|
|
thread,
|
|
|
thread,
|
|
|
time::Duration,
|
|
|
time::Duration,
|
|
|
};
|
|
|
};
|
|
|
|
|
|
use tokio::runtime::Builder;
|
|
|
|
|
|
|
|
|
pub use async_trait::async_trait;
|
|
|
pub use async_trait::async_trait;
|
|
|
|
|
|
|
|
|
pub fn run<F: Future>(future: F) -> F::Output {
|
|
|
pub fn run<F: Future>(future: F) -> F::Output {
|
|
|
tokio::runtime::Runtime::new().unwrap().block_on(future)
|
|
|
|
|
|
|
|
|
Builder::new_current_thread()
|
|
|
|
|
|
.build()
|
|
|
|
|
|
.unwrap()
|
|
|
|
|
|
.block_on(future)
|
|
|
}
|
|
|
}
|
|
|
pub use tokio::try_join;
|
|
|
pub use tokio::try_join;
|
|
|
|
|
|
|
|
|