* @param workerChoiceStrategy - The worker choice strategy to set.
*/
public setWorkerChoiceStrategy (
- pool: IPoolInternal<Worker, Data, Response>,
workerChoiceStrategy: WorkerChoiceStrategy
): void {
if (this.workerChoiceStrategyType === workerChoiceStrategy) {
WorkerChoiceStrategies.ROUND_ROBIN
)
workerChoiceStrategyContext.setWorkerChoiceStrategy(
- fixedPool,
WorkerChoiceStrategies.ROUND_ROBIN
)
expect(
WorkerChoiceStrategies.ROUND_ROBIN
)
workerChoiceStrategyContext.setWorkerChoiceStrategy(
- dynamicPool,
WorkerChoiceStrategies.ROUND_ROBIN
)
expect(
fixedPool
)
workerChoiceStrategyContext.setWorkerChoiceStrategy(
- fixedPool,
WorkerChoiceStrategies.LESS_USED
)
expect(
dynamicPool
)
workerChoiceStrategyContext.setWorkerChoiceStrategy(
- dynamicPool,
WorkerChoiceStrategies.LESS_USED
)
expect(
fixedPool
)
workerChoiceStrategyContext.setWorkerChoiceStrategy(
- fixedPool,
WorkerChoiceStrategies.LESS_BUSY
)
expect(
dynamicPool
)
workerChoiceStrategyContext.setWorkerChoiceStrategy(
- dynamicPool,
WorkerChoiceStrategies.LESS_BUSY
)
expect(
fixedPool
)
workerChoiceStrategyContext.setWorkerChoiceStrategy(
- fixedPool,
WorkerChoiceStrategies.FAIR_SHARE
)
expect(
dynamicPool
)
workerChoiceStrategyContext.setWorkerChoiceStrategy(
- dynamicPool,
WorkerChoiceStrategies.FAIR_SHARE
)
expect(
fixedPool
)
workerChoiceStrategyContext.setWorkerChoiceStrategy(
- fixedPool,
WorkerChoiceStrategies.WEIGHTED_ROUND_ROBIN
)
expect(
dynamicPool
)
workerChoiceStrategyContext.setWorkerChoiceStrategy(
- dynamicPool,
WorkerChoiceStrategies.WEIGHTED_ROUND_ROBIN
)
expect(