X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Futility-types.ts;h=fa1c0ffefdf27e6996789cc444f44d81de9076fc;hb=67e8ef11907ab8ae70740d7c9f4d5d225ed8d522;hp=9ecf56577f999f4d56a5474917d522f644993749;hpb=b93080b79a5e2e5d174991d87e96c97b307df18e;p=poolifier.git diff --git a/src/utility-types.ts b/src/utility-types.ts index 9ecf5657..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,9 +82,13 @@ export interface MessageValue */ readonly statistics?: WorkerStatistics /** - * Whether the worker has started or not. + * Whether the worker is ready or not. + */ + readonly ready?: boolean + /** + * Whether the worker starts or stops its aliveness check. */ - readonly started?: boolean + readonly checkAlive?: boolean } /**