From 04d875a3942abe97ce35c177c6e6f41619be974b Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Mon, 1 Jan 2024 16:00:41 +0100 Subject: [PATCH] refactor: cleanup dead code MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- src/pools/abstract-pool.ts | 8 -------- src/pools/pool.ts | 8 -------- .../abstract-worker-choice-strategy.ts | 2 +- 3 files changed, 1 insertion(+), 17 deletions(-) diff --git a/src/pools/abstract-pool.ts b/src/pools/abstract-pool.ts index 536f4a03..4720e8b4 100644 --- a/src/pools/abstract-pool.ts +++ b/src/pools/abstract-pool.ts @@ -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 && diff --git a/src/pools/pool.ts b/src/pools/pool.ts index 546f67b7..3aa9feb7 100644 --- a/src/pools/pool.ts +++ b/src/pools/pool.ts @@ -240,14 +240,6 @@ export interface IPool< * @internal */ readonly workerNodes: Array> - /** - * 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:--pool`. diff --git a/src/pools/selection-strategies/abstract-worker-choice-strategy.ts b/src/pools/selection-strategies/abstract-worker-choice-strategy.ts index c2928930..0a2b6113 100644 --- a/src/pools/selection-strategies/abstract-worker-choice-strategy.ts +++ b/src/pools/selection-strategies/abstract-worker-choice-strategy.ts @@ -57,8 +57,8 @@ export abstract class AbstractWorkerChoiceStrategy< protected readonly pool: IPool, protected opts?: WorkerChoiceStrategyOptions ) { - this.setOptions(this.opts) this.choose = this.choose.bind(this) + this.setOptions(this.opts) } protected setTaskStatisticsRequirements ( -- 2.34.1