From: Jérôme Benoit Date: Fri, 7 Apr 2023 17:12:57 +0000 (+0200) Subject: refactor: limit properties scope on worker choosing code X-Git-Tag: v2.4.4~6 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=8b4d450024ef06de939fa82f9746b005696914c0;p=poolifier.git refactor: limit properties scope on worker choosing code Signed-off-by: Jérôme Benoit --- diff --git a/src/pools/selection-strategies/abstract-worker-choice-strategy.ts b/src/pools/selection-strategies/abstract-worker-choice-strategy.ts index f32229ec..b0a624da 100644 --- a/src/pools/selection-strategies/abstract-worker-choice-strategy.ts +++ b/src/pools/selection-strategies/abstract-worker-choice-strategy.ts @@ -19,7 +19,7 @@ export abstract class AbstractWorkerChoiceStrategy< Response = unknown > implements IWorkerChoiceStrategy { /** @inheritDoc */ - public readonly isDynamicPool: boolean + protected readonly isDynamicPool: boolean /** @inheritDoc */ public requiredStatistics: RequiredStatistics = { runTime: false, @@ -32,7 +32,7 @@ export abstract class AbstractWorkerChoiceStrategy< * @param pool - The pool instance. */ public constructor ( - public readonly pool: IPoolInternal + protected readonly pool: IPoolInternal ) { this.isDynamicPool = this.pool.type === PoolType.DYNAMIC this.choose.bind(this) diff --git a/src/pools/selection-strategies/selection-strategies-types.ts b/src/pools/selection-strategies/selection-strategies-types.ts index 9acf819b..2c6c2e16 100644 --- a/src/pools/selection-strategies/selection-strategies-types.ts +++ b/src/pools/selection-strategies/selection-strategies-types.ts @@ -41,10 +41,6 @@ export interface RequiredStatistics { * Worker choice strategy interface. */ export interface IWorkerChoiceStrategy { - /** - * Is the pool bound to the strategy dynamic?. - */ - readonly isDynamicPool: boolean /** * Required pool tasks usage statistics. */