ThreadJobDataFunctions: {
    onCancel?: () => void;
    onComplete?: () => void;
    onError?: (error: Error) => void;
    onMessage?: (message: unknown) => void;
}

The function values of the thread job data. This is separated because this cannot be persisted in a database.

Type declaration

  • OptionalonCancel?: () => void

    What should happen when the thread job was cancelled.

  • OptionalonComplete?: () => void

    What should happen when the thread job completes.

  • OptionalonError?: (error: Error) => void

    What should happen when an error occurs inside the thread job.

  • OptionalonMessage?: (message: unknown) => void

    What should happen when a message is received from the thread job.