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

Method parallel_resumable

sdk/node/src/lib.rs:3322–3348  ·  view source on GitHub ↗
(
        &self,
        specs: Vec<AgentStepSpecObject>,
        workflow_id: String,
    )

Source from the content-addressed store, hash-verified

3320 /// configured.
3321 #[napi]
3322 pub async fn parallel_resumable(
3323 &self,
3324 specs: Vec<AgentStepSpecObject>,
3325 workflow_id: String,
3326 ) -> napi::Result<Vec<StepOutcomeObject>> {
3327 let session = self.inner.clone();
3328 let rust_specs: Vec<RustAgentStepSpec> = specs.into_iter().map(Into::into).collect();
3329 let outcomes = get_runtime()
3330 .spawn(async move {
3331 let Some(store) = session.session_store() else {
3332 return Err("parallelResumable requires a sessionStore on the session");
3333 };
3334 let executor = session.agent_executor();
3335 Ok(execute_steps_parallel_resumable(
3336 executor,
3337 rust_specs,
3338 &workflow_id,
3339 store,
3340 None,
3341 )
3342 .await)
3343 })
3344 .await
3345 .map_err(|e| napi::Error::from_reason(format!("Task join error: {e}")))?
3346 .map_err(napi::Error::from_reason)?;
3347 Ok(outcomes.into_iter().map(StepOutcomeObject::from).collect())
3348 }
3349
3350 /// Run each item through a chain of `stages`, with no barrier between
3351 /// stages — item A can be in stage 3 while item B is still in stage 1.

Callers

nothing calls this directly

Calls 6

session_storeMethod · 0.80
agent_executorMethod · 0.80
get_runtimeFunction · 0.70
cloneMethod · 0.45
spawnMethod · 0.45

Tested by

no test coverage detected