- this.setWorkerChoiceStrategy(workerChoiceStrategy)
- }
-
- /**
- * Gets the worker choice strategy instance specific to the pool type.
- *
- * @param workerChoiceStrategy The worker choice strategy.
- * @returns The worker choice strategy instance for the pool type.
- */
- private getPoolWorkerChoiceStrategy (
- workerChoiceStrategy: WorkerChoiceStrategy = WorkerChoiceStrategies.ROUND_ROBIN
- ): IWorkerChoiceStrategy<Worker> {
- if (this.pool.type === PoolType.DYNAMIC) {
- return new DynamicPoolWorkerChoiceStrategy(
- this.pool,
- this.createDynamicallyWorkerCallback,
- workerChoiceStrategy
- )
- }
- return SelectionStrategiesUtils.getWorkerChoiceStrategy(
- this.pool,
+ this.execute.bind(this)
+ this.workerChoiceStrategy = getWorkerChoiceStrategy<Worker, Data, Response>(
+ pool,