- 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 {
- if (this.pool.type === PoolType.DYNAMIC) {
- return new DynamicPoolWorkerChoiceStrategy(
- this.pool,
- this.createWorkerCallback,
- workerChoiceStrategy
- )
- }
- return getWorkerChoiceStrategy(this.pool, workerChoiceStrategy)