MCPcopy Create free account
hub / github.com/andywer/threads.js / postJobErrorMessage

Function postJobErrorMessage

src/worker/index.ts:70–78  ·  view source on GitHub ↗
(uid: number, rawError: Error | TransferDescriptor<Error>)

Source from the content-addressed store, hash-verified

68}
69
70function postJobErrorMessage(uid: number, rawError: Error | TransferDescriptor<Error>) {
71 const { payload: error, transferables } = deconstructTransfer(rawError)
72 const errorMessage: WorkerJobErrorMessage = {
73 type: WorkerMessageType.error,
74 uid,
75 error: serialize(error) as any as SerializedError
76 }
77 Implementation.postMessageToMaster(errorMessage, transferables)
78}
79
80function postJobResultMessage(uid: number, completed: boolean, resultValue?: any) {
81 const { payload, transferables } = deconstructTransfer(resultValue)

Callers 1

runFunctionFunction · 0.85

Calls 3

serializeFunction · 0.90
deconstructTransferFunction · 0.85
postMessageToMasterMethod · 0.80

Tested by

no test coverage detected