From: Jérôme Benoit Date: Mon, 1 Jan 2024 15:00:41 +0000 (+0100) Subject: refactor: cleanup dead code X-Git-Tag: v3.1.15-0~6 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=04d875a3942abe97ce35c177c6e6f41619be974b;p=poolifier.git refactor: cleanup dead code Signed-off-by: Jérôme Benoit --- 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 (