( host: HostConnection, child: ChildProcess, code: number | null, signal: NodeJS.Signals | null, )
| 331 | } |
| 332 | |
| 333 | function 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 | |
| 350 | async function ensureRuntimeHost(host: HostConnection) { |
| 351 | if (runtimeHostsShuttingDown) { |
no test coverage detected