MCPcopy Create free account
hub / github.com/Pometry/Raphtory / get_runtime

Function get_runtime

raphtory/src/python/utils/mod.rs:427–436  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

425static RUNTIME: OnceLock<Runtime> = OnceLock::new();
426
427pub fn get_runtime() -> &'static Runtime {
428 RUNTIME.get_or_init(|| {
429 Builder::new_multi_thread()
430 .enable_all()
431 // Optional: limit threads if you want to leave room for Python
432 .worker_threads(4)
433 .build()
434 .expect("Failed to create Tokio runtime")
435 })
436}
437
438pub fn block_on<F: Future>(future: F) -> F::Output {
439 get_runtime().block_on(future)

Callers 2

execute_async_taskFunction · 0.85
block_onFunction · 0.85

Calls 2

get_or_initMethod · 0.80
buildMethod · 0.45

Tested by

no test coverage detected