MCPcopy Create free account
hub / github.com/Effect-TS/effect / end

Method end

packages/platform/node-shared/src/internal/proxyProcess.ts:465–485  ·  view source on GitHub ↗
(cause: Error)

Source from the content-addressed store, hash-verified

463 }
464
465 private end(cause: Error): void {
466 if (this.exited) return
467 this.exited = true
468 for (const timer of this.timers.values()) clearTimeout(timer)
469 this.timers.clear()
470 if (!this.ready) this.unref()
471 const unacknowledged = new Error(
472 "The proxy process stopped after the command was sent to it but before it replied, so the command may have started",
473 { cause }
474 )
475 const lost = new Error("The proxy process exited before the command's exit status was received", { cause })
476 // Every command is marked lost before anything else can run
477 const reports = Array.from(
478 this.commands.values(),
479 (command) => command.onLost(command.pid !== undefined ? lost : unacknowledged)
480 )
481 this.disconnect()
482 for (const report of reports) report()
483 // Has no effect on a proxy process that was ready
484 Deferred.doneUnsafe(this.started, Exit.fail(cause))
485 }
486}
487
488const toStartError = (options: Options) => (error: NodeJS.ErrnoException): PlatformError.PlatformError => {

Callers 3

constructorMethod · 0.95
stopMethod · 0.95
sendMethod · 0.95

Calls 7

unrefMethod · 0.95
disconnectMethod · 0.95
fromMethod · 0.80
onLostMethod · 0.80
clearMethod · 0.65
failMethod · 0.65
reportFunction · 0.50

Tested by

no test coverage detected