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

Function handleMainResponse

desktop/runtime-host/main-request-client.ts:20–32  ·  view source on GitHub ↗
(message: RuntimeHostMainResponseMessage)

Source from the content-addressed store, hash-verified

18>()
19
20export function handleMainResponse(message: RuntimeHostMainResponseMessage) {
21 const pending = pendingMainRequests.get(message.id)
22 if (!pending) return
23 pendingMainRequests.delete(message.id)
24 clearTimeout(pending.timeout)
25 if (message.ok) {
26 pending.resolve(message.result)
27 return
28 }
29 const error = new Error(message.error)
30 if (message.stack) error.stack = message.stack
31 pending.reject(error)
32}
33
34export async function invokeMainRequest<TName extends RuntimeHostMainRequestName>(
35 name: TName,

Callers 1

worker.tsFile · 0.90

Calls 1

getMethod · 0.80

Tested by

no test coverage detected