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

Function get_runtime

sdk/python/src/lib.rs:124–137  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

122};
123
124fn get_runtime() -> &'static Runtime {
125 use std::sync::OnceLock;
126 static RUNTIME: OnceLock<Runtime> = OnceLock::new();
127 RUNTIME.get_or_init(|| {
128 // Optimized runtime configuration for I/O-intensive workloads
129 tokio::runtime::Builder::new_multi_thread()
130 .worker_threads(num_cpus::get() * 2) // 2x CPU cores for better I/O handling
131 .max_blocking_threads(512) // More blocking threads for CPU-intensive tasks
132 .thread_name("a3s-code-worker")
133 .enable_all()
134 .build()
135 .expect("Failed to create tokio runtime")
136 })
137}
138
139fn json_string_to_py(py: Python<'_>, json: &str) -> PyResult<PyObject> {
140 let json_module = py.import("json")?;

Callers 15

__call__Method · 0.70
__next__Method · 0.70
createMethod · 0.70
serve_agent_dirMethod · 0.70
refresh_mcp_toolsMethod · 0.70
list_sessionsMethod · 0.70
close_sessionMethod · 0.70
closeMethod · 0.70
disconnect_idle_mcpMethod · 0.70
sendMethod · 0.70
resume_runMethod · 0.70
parallelMethod · 0.70

Calls 2

expectMethod · 0.80
buildMethod · 0.45

Tested by

no test coverage detected