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

Method spawn

sdk/node/src/lib.rs:121–132  ·  view source on GitHub ↗
(&self, fut: F)

Source from the content-addressed store, hash-verified

119
120impl NapiRuntime {
121 fn spawn<F>(&self, fut: F) -> tokio::task::JoinHandle<F::Output>
122 where
123 F: Future + Send + 'static,
124 F::Output: Send + 'static,
125 {
126 // Try the current runtime first; otherwise use the binding-owned runtime.
127 if let Ok(handle) = tokio::runtime::Handle::try_current() {
128 handle.spawn(fut)
129 } else {
130 fallback_runtime().spawn(fut)
131 }
132 }
133
134 fn block_on<F: Future>(&self, fut: F) -> F::Output {
135 if let Ok(handle) = tokio::runtime::Handle::try_current() {

Callers 15

serve_agent_dirMethod · 0.45
send_session_requestFunction · 0.45
stream_session_requestFunction · 0.45
nextMethod · 0.45
createMethod · 0.45
serve_agent_dirMethod · 0.45
resume_runMethod · 0.45
parallelMethod · 0.45
parallel_resumableMethod · 0.45
pipelineMethod · 0.45
send_with_attachmentsMethod · 0.45

Calls 1

fallback_runtimeFunction · 0.85

Tested by

no test coverage detected