chore: v2.6.29
[poolifier.git] / src / pools / pool.ts
index 6f3d9561a158c7815c007a2a2ebf631ee1e163bc..e65cc115d2d77c0a0590fa5f936043b16dcb38d2 100644 (file)
@@ -178,8 +178,18 @@ export interface IPool<
   readonly info: PoolInfo
   /**
    * Pool worker nodes.
+   *
+   * @internal
    */
   readonly workerNodes: Array<IWorkerNode<Worker, Data>>
+  /**
+   * Whether the worker node has back pressure (i.e. its tasks queue is full).
+   *
+   * @param workerNodeKey - The worker node key.
+   * @returns `true` if the worker node has back pressure, `false` otherwise.
+   * @internal
+   */
+  readonly hasWorkerNodeBackPressure: (workerNodeKey: number) => boolean
   /**
    * Emitter on which events can be listened to.
    *
@@ -191,7 +201,7 @@ export interface IPool<
    * - '`destroy`': Emitted when the pool is destroyed.
    * - `'error'`: Emitted when an uncaught error occurs.
    * - `'taskError'`: Emitted when an error occurs while executing a task.
-   * - `'backPressure'`: Emitted when a worker node has back pressure (i.e. its tasks queue is full).
+   * - `'backPressure'`: Emitted when all worker nodes have back pressure (i.e. their tasks queue is full: queue size \>= pool maximum size^2).
    */
   readonly emitter?: PoolEmitter
   /**