MCPcopy Index your code
hub / github.com/simstudioai/sim / readyHandler

Function readyHandler

apps/sim/lib/execution/isolated-vm.ts:981–999  ·  view source on GitHub ↗
(message: unknown)

Source from the content-addressed store, hash-verified

979 }, 10000)
980
981 const readyHandler = (message: unknown) => {
982 if (
983 typeof message === 'object' &&
984 message !== null &&
985 (message as { type?: string }).type === 'ready'
986 ) {
987 if (!settleSpawnInProgress()) {
988 proc.off('message', readyHandler)
989 return
990 }
991 workerInfo.ready = true
992 clearTimeout(startTimeout)
993 proc.off('message', readyHandler)
994 workers.set(workerId, workerInfo)
995 resetWorkerIdleTimeout(workerId)
996 logger.info('Worker spawned and ready', { workerId, poolSize: workers.size })
997 resolve()
998 }
999 }
1000 proc.on('message', readyHandler)
1001
1002 proc.on('exit', () => {

Callers

nothing calls this directly

Calls 6

settleSpawnInProgressFunction · 0.85
resetWorkerIdleTimeoutFunction · 0.85
offMethod · 0.80
infoMethod · 0.80
setMethod · 0.65
resolveFunction · 0.50

Tested by

no test coverage detected