(host: HostConnection)
| 186 | } |
| 187 | |
| 188 | function scheduleThreadHostIdleStop(host: HostConnection) { |
| 189 | if (host.role !== 'thread' || host.pendingRequests.size > 0 || host.busy) return |
| 190 | if (host.idleTimer) clearTimeout(host.idleTimer) |
| 191 | host.idleTimer = setTimeout(() => { |
| 192 | if (host.pendingRequests.size > 0) return |
| 193 | terminateHostProcess(host.process) |
| 194 | forgetHost(host) |
| 195 | }, THREAD_HOST_IDLE_MS) |
| 196 | } |
| 197 | |
| 198 | function clearHostIdleTimer(host: HostConnection) { |
| 199 | if (!host.idleTimer) return |
no test coverage detected