refactor: cleanup dead code
authorJérôme Benoit <jerome.benoit@piment-noir.org>
Mon, 1 Jan 2024 15:00:41 +0000 (16:00 +0100)
committerJérôme Benoit <jerome.benoit@piment-noir.org>
Mon, 1 Jan 2024 15:00:41 +0000 (16:00 +0100)
Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
src/pools/abstract-pool.ts
src/pools/pool.ts
src/pools/selection-strategies/abstract-worker-choice-strategy.ts

index 536f4a03d8a0b2e052bc515b972d1de8098a94ae..4720e8b4354fd5efa5245f8381a0bab023d0fbfb 100644 (file)
@@ -1845,14 +1845,6 @@ export abstract class AbstractPool<
     this.getWorkerInfo(workerNodeKey).ready = false
   }
 
-  /** @inheritDoc */
-  public hasWorkerNodeBackPressure (workerNodeKey: number): boolean {
-    return (
-      this.opts.enableTasksQueue === true &&
-      this.workerNodes[workerNodeKey].hasBackPressure()
-    )
-  }
-
   private hasBackPressure (): boolean {
     return (
       this.opts.enableTasksQueue === true &&
index 546f67b79ad8f48cf1019cdc67d132c41975c0b4..3aa9feb70b04d8ea3b321777dd053d9823d994b0 100644 (file)
@@ -240,14 +240,6 @@ export interface IPool<
    * @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
   /**
    * Event emitter integrated with async resource on which events can be listened to.
    * The async tracking tooling identifier is `poolifier:<PoolType>-<WorkerType>-pool`.
index c2928930724d34a19687bde75de870d1dc9c4afb..0a2b6113b8451bfabfd7fc866d59cc71b2f95ef2 100644 (file)
@@ -57,8 +57,8 @@ export abstract class AbstractWorkerChoiceStrategy<
     protected readonly pool: IPool<Worker, Data, Response>,
     protected opts?: WorkerChoiceStrategyOptions
   ) {
-    this.setOptions(this.opts)
     this.choose = this.choose.bind(this)
+    this.setOptions(this.opts)
   }
 
   protected setTaskStatisticsRequirements (