build: refine editorconfig configuration
[poolifier.git] / src / pools / selection-strategies / abstract-worker-choice-strategy.ts
index 5c2a553d187b92fe5793fac750a7ae2c5d0d9e82..44e7e3f8b5ea01b7c707e0754f580b9181ea9a4b 100644 (file)
@@ -7,7 +7,7 @@ import type {
 } from './selection-strategies-types'
 
 /**
- * Abstract worker choice strategy class.
+ * Worker choice strategy abstract base class.
  *
  * @typeParam Worker - Type of worker which manages the strategy.
  * @typeParam Data - Type of data sent to the worker. This can only be serializable data.
@@ -17,7 +17,7 @@ export abstract class AbstractWorkerChoiceStrategy<
   Worker extends IPoolWorker,
   Data,
   Response
-> implements IWorkerChoiceStrategy {
+> implements IWorkerChoiceStrategy<Worker, Data, Response> {
   /** {@inheritDoc} */
   public readonly isDynamicPool: boolean
   /** {@inheritDoc} */
@@ -32,9 +32,10 @@ export abstract class AbstractWorkerChoiceStrategy<
    * @param pool - The pool instance.
    */
   public constructor (
-    protected readonly pool: IPoolInternal<Worker, Data, Response>
+    public readonly pool: IPoolInternal<Worker, Data, Response>
   ) {
     this.isDynamicPool = this.pool.type === PoolType.DYNAMIC
+    this.choose.bind(this)
   }
 
   /** {@inheritDoc} */