INNER CODE UNIT · TypeScript

postJobStartMessage

andywer/threads.js · src/worker/index.ts:91

function postJobStartMessage(uid: number, resultType: WorkerJobStartMessage["resultType"]) {
  const startMessage: WorkerJobStartMessage = {
    type: WorkerMessageType.running,
    uid,
    resultType
  }
  Implementation.postMessageToMaster(startMessage)
}

function postUncaughtErrorMessage(error: Error) {
  try {
    const errorMessage: WorkerUncaughtErrorMessage = {
      type: WorkerMessageType.uncaughtError,
      error: serialize(error) as any as SerializedError
    }
    Implementation.postMessageToMaster(errorMessage)
  } catch (subError) {
    // tslint:disable-next-line no-console

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…