feat: add worker info to worker nodes
[poolifier.git] / src / utility-types.ts
index f330d192296dcc62a5b86a4209126d21798acff6..1f724274150f401833df2dec47750528235a578e 100644 (file)
@@ -53,6 +53,10 @@ export interface WorkerStatistics {
  */
 export interface MessageValue<Data = unknown, ErrorData = unknown>
   extends Task<Data> {
+  /**
+   * Worker Id.
+   */
+  readonly workerId?: number
   /**
    * Kill code.
    */
@@ -66,9 +70,13 @@ export interface MessageValue<Data = unknown, ErrorData = unknown>
    */
   readonly taskPerformance?: TaskPerformance
   /**
-   * Whether to compute the given statistics or not.
+   * Whether the worker computes the given statistics or not.
    */
   readonly statistics?: WorkerStatistics
+  /**
+   * Whether the worker has started or not.
+   */
+  readonly started?: boolean
 }
 
 /**