MCPcopy Index your code
hub / github.com/AI45Lab/Code / fallback_runtime

Function fallback_runtime

sdk/node/src/lib.rs:109–118  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

107struct NapiRuntime;
108
109fn fallback_runtime() -> &'static tokio::runtime::Runtime {
110 static RUNTIME: OnceLock<tokio::runtime::Runtime> = OnceLock::new();
111 RUNTIME.get_or_init(|| {
112 tokio::runtime::Builder::new_multi_thread()
113 .enable_all()
114 .thread_name("a3s-code-node-worker")
115 .build()
116 .expect("failed to create Tokio runtime for Node bindings")
117 })
118}
119
120impl NapiRuntime {
121 fn spawn<F>(&self, fut: F) -> tokio::task::JoinHandle<F::Output>

Callers 3

spawnMethod · 0.85
block_onMethod · 0.85
build_test_sessionFunction · 0.85

Calls 2

expectMethod · 0.80
buildMethod · 0.45

Tested by

no test coverage detected