refactor: limit properties scope on worker choosing code
authorJérôme Benoit <jerome.benoit@sap.com>
Fri, 7 Apr 2023 17:12:57 +0000 (19:12 +0200)
committerJérôme Benoit <jerome.benoit@sap.com>
Fri, 7 Apr 2023 17:12:57 +0000 (19:12 +0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
src/pools/selection-strategies/abstract-worker-choice-strategy.ts
src/pools/selection-strategies/selection-strategies-types.ts

index f32229ec3da8550d49263f2ed76a434a63d6d97b..b0a624da9d5afb7b563d2a069e2b04866b02163a 100644 (file)
@@ -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<Worker, Data, Response>
+    protected readonly pool: IPoolInternal<Worker, Data, Response>
   ) {
     this.isDynamicPool = this.pool.type === PoolType.DYNAMIC
     this.choose.bind(this)
index 9acf819b8b858900a1d42a5a681d7f001b152edf..2c6c2e16d6e4d52e7f19841e6d6f331db3d678f9 100644 (file)
@@ -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.
    */