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

Method stopRuntime

projects/runtime/src/server.ts:523–539  ·  view source on GitHub ↗
(params: RuntimeStopParams, context: RuntimeHandlerContext)

Source from the content-addressed store, hash-verified

521 }
522
523 private async stopRuntime(params: RuntimeStopParams, context: RuntimeHandlerContext): Promise<RuntimeRecord | null> {
524 const current = this.supervisor.get(params.runtimeId)
525 if (!current) return null
526
527 for (const handler of this.runtimeStopHandlers) {
528 if (await handler(current, params, context)) break
529 }
530
531 const afterHandler = this.supervisor.get(params.runtimeId)
532 if (isTerminalRuntimeStatus(afterHandler?.status)) {
533 if (afterHandler?.status === "stopped" || !isActiveRuntimeStatus(current.status)) return afterHandler ?? null
534 }
535
536 const stopped = this.supervisor.stop(params.runtimeId, params.reason) ?? null
537 if (stopped) this.notify("runtime/stopped", stopped)
538 return stopped
539 }
540}

Callers 1

constructorMethod · 0.95

Calls 6

notifyMethod · 0.95
isTerminalRuntimeStatusFunction · 0.85
isActiveRuntimeStatusFunction · 0.85
getMethod · 0.65
stopMethod · 0.65
handlerFunction · 0.50

Tested by

no test coverage detected