pub mod agent; pub mod connections; pub mod env; use std::future::Future; use std::thread; use tokio::runtime::Runtime; // tokio runtime cannot be created inside another runtime, // so i create a separate non-'static thread not to interfere fn run_async(fut: impl Future + Send) -> R { thread::scope(|s| { s.spawn(|| Runtime::new().unwrap().block_on(fut)) .join() .expect("async task failed") }) }