MCPcopy Create free account
hub / github.com/bearlyai/OpenADE / killAll

Function killAll

projects/runtime-node/src/localProcess.ts:216–242  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

214 return { ok: true }
215 },
216 async killAll() {
217 for (const [id, state] of local.active) {
218 if (state.timeout) clearTimeout(state.timeout)
219 if (state.cleanup) clearTimeout(state.cleanup)
220
221 if (!state.completed) {
222 state.completed = true
223 state.exitCode = null
224 state.signal = "SIGKILL"
225 try {
226 if (process.platform !== "win32" && state.process.pid) process.kill(-state.process.pid, "SIGKILL")
227 else state.process.kill("SIGKILL")
228 } catch {
229 try {
230 state.process.kill("SIGKILL")
231 } catch {
232 // The process may already be gone; the runtime still needs a terminal lifecycle event.
233 }
234 }
235 emit(local, { type: "exit", processId: id, exitCode: null, signal: "SIGKILL" })
236 }
237
238 if (state.tempScriptPath) await fs.rm(state.tempScriptPath, { force: true }).catch(() => undefined)
239 local.active.delete(id)
240 }
241 return { ok: true }
242 },
243 }
244}

Callers

nothing calls this directly

Calls 3

emitFunction · 0.70
killMethod · 0.65
deleteMethod · 0.65

Tested by

no test coverage detected