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

Function scheduleThreadHostIdleStop

desktop/runtime-host/client-bridge.ts:188–196  ·  view source on GitHub ↗
(host: HostConnection)

Source from the content-addressed store, hash-verified

186}
187
188function 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
198function clearHostIdleTimer(host: HostConnection) {
199 if (!host.idleTimer) return

Callers 4

invokeRuntimeHostFunction · 0.85
invokeRuntimeHostOnHostFunction · 0.85

Calls 2

terminateHostProcessFunction · 0.85
forgetHostFunction · 0.85

Tested by

no test coverage detected