use std::future::Future;
#[cfg(any(target_env = "sgx", feature = "debug-mock-sgx"))]
pub fn new_tokio_runtime() -> tokio::runtime::Runtime {
tokio::runtime::Builder::new_multi_thread()
.worker_threads(6)
.max_blocking_threads(16)
.thread_keep_alive(std::time::Duration::MAX)
.enable_all()
.build()
.unwrap()
}
#[cfg(not(any(target_env = "sgx", feature = "debug-mock-sgx")))]
pub fn new_tokio_runtime() -> tokio::runtime::Runtime {
tokio::runtime::Runtime::new().unwrap()
}
pub fn block_on<F: Future>(future: F) -> F::Output {
tokio::runtime::Handle::current().block_on(future)
}