1use once_cell::sync::OnceCell;
10use querent::errors::QuerentError;
11use tokio::runtime::{Builder, Runtime};
12
13pub mod callbacks;
14pub mod comm;
15pub mod config;
16pub mod cross;
17pub mod querent;
18#[cfg(test)]
19mod tests;
20pub mod util;
21
22pub fn tokio_runtime() -> Result<&'static Runtime, QuerentError> {
23 static RUNTIME: OnceCell<Runtime> = OnceCell::new();
24
25 RUNTIME.get_or_try_init(|| {
26 Builder::new_multi_thread()
27 .enable_all()
28 .build()
29 .map_err(|err| QuerentError::internal(err.to_string()))
30 })
31}