X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Futility-types.ts;h=9ecf56577f999f4d56a5474917d522f644993749;hb=f0376671beab5dcccfe496375c30153875a38f90;hp=0443b4ceef2374e28ba8201bf5d1d6a61ebbce93;hpb=83fa0a36c7d67362593915f3b19867f8fbbcbcce;p=poolifier.git diff --git a/src/utility-types.ts b/src/utility-types.ts index 0443b4ce..9ecf5657 100644 --- a/src/utility-types.ts +++ b/src/utility-types.ts @@ -8,36 +8,44 @@ import type { IWorker, Task } from './pools/worker' * @typeParam Data - Type of data sent to the worker triggering an error. This can only be structured-cloneable data. */ export interface TaskError { + /** + * Worker id. + */ + readonly workerId: number /** * Error message. */ - message: string + readonly message: string /** * Data passed to the worker triggering the error. */ - data?: Data + readonly data?: Data } /** * Task performance. + * + * @internal */ export interface TaskPerformance { /** * Task performance timestamp. */ - timestamp: number + readonly timestamp: number /** * Task runtime. */ - runTime?: number + readonly runTime?: number /** * Task event loop utilization. */ - elu?: EventLoopUtilization + readonly elu?: EventLoopUtilization } /** * Performance statistics computation. + * + * @internal */ export interface WorkerStatistics { runTime: boolean