perf: remove unneeded class indirection for dynamic pool in worker
[poolifier.git] / src / pools / selection-strategies / abstract-worker-choice-strategy.ts
index 5c2a553d187b92fe5793fac750a7ae2c5d0d9e82..aa370fe433e74065e4155d8612499abef5ec59fb 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.
@@ -35,6 +35,7 @@ export abstract class AbstractWorkerChoiceStrategy<
     protected readonly pool: IPoolInternal<Worker, Data, Response>
   ) {
     this.isDynamicPool = this.pool.type === PoolType.DYNAMIC
+    this.choose.bind(this)
   }
 
   /** {@inheritDoc} */