MCPcopy Create free account
hub / github.com/IgorWarzocha/howcode / handleHostExit

Function handleHostExit

desktop/runtime-host/client-bridge.ts:333–348  ·  view source on GitHub ↗
(
  host: HostConnection,
  child: ChildProcess,
  code: number | null,
  signal: NodeJS.Signals | null,
)

Source from the content-addressed store, hash-verified

331}
332
333function handleHostExit(
334 host: HostConnection,
335 child: ChildProcess,
336 code: number | null,
337 signal: NodeJS.Signals | null,
338) {
339 if (host.process === child) host.process = null
340 host.startPromise = null
341 rejectPendingRequests(
342 host,
343 new Error(
344 `Pi runtime host ${host.label} exited${code === null ? '' : ` with code ${code}`}${signal ? ` (${signal})` : ''}.`,
345 ),
346 )
347 if (host.role === 'thread') forgetHost(host)
348}
349
350async function ensureRuntimeHost(host: HostConnection) {
351 if (runtimeHostsShuttingDown) {

Callers 1

ensureRuntimeHostFunction · 0.85

Calls 2

rejectPendingRequestsFunction · 0.85
forgetHostFunction · 0.85

Tested by

no test coverage detected