- this.execute.bind(this)
- this.workerChoiceStrategy = getWorkerChoiceStrategy<Worker, Data, Response>(
- pool,
- this.workerChoiceStrategyType
- )
+ this.execute = this.execute.bind(this)
+ this.workerChoiceStrategies = new Map<
+ WorkerChoiceStrategy,
+ IWorkerChoiceStrategy
+ >([
+ [
+ WorkerChoiceStrategies.ROUND_ROBIN,
+ new (RoundRobinWorkerChoiceStrategy.bind(this))<Worker, Data, Response>(
+ pool,
+ opts
+ )
+ ],
+ [
+ WorkerChoiceStrategies.LEAST_USED,
+ new (LeastUsedWorkerChoiceStrategy.bind(this))<Worker, Data, Response>(
+ pool,
+ opts
+ )
+ ],
+ [
+ WorkerChoiceStrategies.LEAST_BUSY,
+ new (LeastBusyWorkerChoiceStrategy.bind(this))<Worker, Data, Response>(
+ pool,
+ opts
+ )
+ ],
+ [
+ WorkerChoiceStrategies.LEAST_ELU,
+ new (LeastEluWorkerChoiceStrategy.bind(this))<Worker, Data, Response>(
+ pool,
+ opts
+ )
+ ],
+ [
+ WorkerChoiceStrategies.FAIR_SHARE,
+ new (FairShareWorkerChoiceStrategy.bind(this))<Worker, Data, Response>(
+ pool,
+ opts
+ )
+ ],
+ [
+ WorkerChoiceStrategies.WEIGHTED_ROUND_ROBIN,
+ new (WeightedRoundRobinWorkerChoiceStrategy.bind(this))<
+ Worker,
+ Data,
+ Response
+ >(pool, opts)
+ ],
+ [
+ WorkerChoiceStrategies.INTERLEAVED_WEIGHTED_ROUND_ROBIN,
+ new (InterleavedWeightedRoundRobinWorkerChoiceStrategy.bind(this))<
+ Worker,
+ Data,
+ Response
+ >(pool, opts)
+ ]
+ ])
+ this.retries = getWorkerChoiceStrategyRetries(pool, opts)