MCPcopy
hub / github.com/lightningpixel/modly / handler

Method handler

electron/main/process-runner.ts:128–140  ·  view source on GitHub ↗
(msg: { type: string; result?: ProcessResult; message?: string; percent?: number; label?: string })

Source from the content-addressed store, hash-verified

126
127 return new Promise((resolve, reject) => {
128 const handler = (msg: { type: string; result?: ProcessResult; message?: string; percent?: number; label?: string }) => {
129 if (msg.type === 'progress') {
130 onProgress?.(msg.percent ?? 0, msg.label ?? '')
131 } else if (msg.type === 'log') {
132 onLog?.(msg.message ?? '')
133 } else if (msg.type === 'done') {
134 worker.off('message', handler)
135 resolve(msg.result ?? {})
136 } else if (msg.type === 'error') {
137 worker.off('message', handler)
138 reject(new Error(msg.message))
139 }
140 }
141
142 worker.on('message', handler)
143 worker.postMessage({ action: 'run', input, params })

Callers

nothing calls this directly

Calls 1

resolveFunction · 0.85

Tested by

no test coverage detected