pub mod frame;
pub mod id;
pub mod pair;
mod door;
mod elect;
mod node;
mod router;
pub use elect::{embed, runtime_dir, socket_path};
pub use frame::{Descriptor, Entry};
pub use id::host;
pub use node::Node;
pub(crate) fn runtime() -> &'static tokio::runtime::Runtime {
static RT: std::sync::OnceLock<tokio::runtime::Runtime> = std::sync::OnceLock::new();
RT.get_or_init(|| {
tokio::runtime::Builder::new_multi_thread()
.worker_threads(2)
.thread_name("zapd-io")
.enable_all()
.build()
.expect("zapd runtime")
})
}
pub fn block_on<F: std::future::Future>(f: F) -> F::Output {
runtime().block_on(f)
}