refactor: cleanup message passing code
[poolifier.git] / src / utility-types.ts
index a2f3de1c293475ba8089c91a5715508c4e9d52cb..2035235022d13f49cb39c98e3ea10b91cf7ca8ec 100644 (file)
@@ -24,6 +24,8 @@ export interface TaskError<Data = unknown> {
 
 /**
  * Task performance.
+ *
+ * @internal
  */
 export interface TaskPerformance {
   /**
@@ -42,6 +44,8 @@ export interface TaskPerformance {
 
 /**
  * Performance statistics computation.
+ *
+ * @internal
  */
 export interface WorkerStatistics {
   runTime: boolean
@@ -64,7 +68,7 @@ export interface MessageValue<Data = unknown, ErrorData = unknown>
   /**
    * Kill code.
    */
-  readonly kill?: KillBehavior | 1
+  readonly kill?: KillBehavior | true
   /**
    * Task error.
    */
@@ -81,6 +85,10 @@ export interface MessageValue<Data = unknown, ErrorData = unknown>
    * Whether the worker has started or not.
    */
   readonly started?: boolean
+  /**
+   * Whether the worker starts or stops its aliveness check.
+   */
+  readonly checkAlive?: boolean
 }
 
 /**