* Worker choice strategy context constructor.
*
* @param pool - The pool instance.
- * @param createWorkerCallback - The worker creation callback for dynamic pool.
- * @param workerChoiceStrategy - The worker choice strategy.
+ * @param workerChoiceStrategyType - The worker choice strategy.
*/
public constructor (
pool: IPoolInternal<Worker, Data, Response>,
public setWorkerChoiceStrategy (
workerChoiceStrategy: WorkerChoiceStrategy
): void {
- if (this.workerChoiceStrategyType === workerChoiceStrategy) {
- this.workerChoiceStrategies.get(workerChoiceStrategy)?.reset()
- } else {
+ if (this.workerChoiceStrategyType !== workerChoiceStrategy) {
this.workerChoiceStrategyType = workerChoiceStrategy
}
+ this.workerChoiceStrategies.get(this.workerChoiceStrategyType)?.reset()
}
/**