X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Futility-types.ts;h=fa1c0ffefdf27e6996789cc444f44d81de9076fc;hb=67e8ef11907ab8ae70740d7c9f4d5d225ed8d522;hp=980c00896a0ebf23f75162605cccf52548cc535f;hpb=18fea9f10a9d1fd8bbbc4738284939868faa0db5;p=poolifier.git diff --git a/src/utility-types.ts b/src/utility-types.ts index 980c0089..fa1c0ffe 100644 --- a/src/utility-types.ts +++ b/src/utility-types.ts @@ -9,15 +9,15 @@ import type { IWorker, Task } from './pools/worker' */ export interface TaskError { /** - * Worker id. + * Task name triggering the error. */ - readonly workerId: number + readonly name: string /** * Error message. */ readonly message: string /** - * Data passed to the worker triggering the error. + * Data triggering the error. */ readonly data?: Data } @@ -28,6 +28,10 @@ export interface TaskError { * @internal */ export interface TaskPerformance { + /** + * Task name. + */ + readonly name: string /** * Task performance timestamp. */ @@ -61,14 +65,10 @@ export interface WorkerStatistics { */ export interface MessageValue extends Task { - /** - * Worker id. - */ - readonly workerId?: number /** * Kill code. */ - readonly kill?: KillBehavior | 1 + readonly kill?: KillBehavior | true /** * Task error. */ @@ -82,13 +82,13 @@ export interface MessageValue */ readonly statistics?: WorkerStatistics /** - * Whether the worker has started or not. + * Whether the worker is ready or not. */ - readonly started?: boolean + readonly ready?: boolean /** - * Whether the worker is dynamic or not. + * Whether the worker starts or stops its aliveness check. */ - readonly dynamic?: boolean + readonly checkAlive?: boolean } /**