#[cfg(not(target_arch = "wasm32"))] use std::sync::LazyLock; #[cfg(not(target_arch = "wasm32"))] pub static RT: LazyLock = LazyLock::new(|| { tokio::runtime::Builder::new_multi_thread() .enable_all() .build() .expect("Failed to initialize tokio runtime") }); #[cfg(not(target_arch = "wasm32"))] pub fn spawn(f: impl Future + Send + 'static) { RT.spawn(f); } #[cfg(target_arch = "wasm32")] pub fn spawn(f: impl Future + 'static) { wasm_bindgen_futures::spawn_local(f); }