MCPcopy
hub / github.com/simstudioai/sim / spawn

Function spawn

apps/sim/lib/execution/isolated-vm.test.ts:107–120  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

105 let lastExecutionId = 0
106
107 const spawn: SpawnFactory = () => {
108 const current = createBaseProc()
109 current.send = (message: unknown) => {
110 const msg = message as { type?: string; executionId?: number }
111 if (msg.type === 'execute') {
112 lastExecutionId = msg.executionId ?? 0
113 markDispatched()
114 }
115 return true
116 }
117 setImmediate(() => current.emit('message', { type: 'ready' }))
118 proc = current
119 return current
120 }
121
122 const release = (result: unknown = 'released') => {
123 proc?.emit('message', {

Callers 3

isDockerRunningFunction · 0.85
runCommandFunction · 0.85
spawnWorkerFunction · 0.85

Calls 2

createBaseProcFunction · 0.85
markDispatchedFunction · 0.85

Tested by

no test coverage detected