const workerChoiceStrategyContext = new WorkerChoiceStrategyContext(
fixedPool
)
+ expect(
+ workerChoiceStrategyContext.workerChoiceStrategies.get(
+ WorkerChoiceStrategies.ROUND_ROBIN
+ ).isDynamicPool
+ ).toBe(false)
expect(
workerChoiceStrategyContext.workerChoiceStrategies.get(
WorkerChoiceStrategies.ROUND_ROBIN
const workerChoiceStrategyContext = new WorkerChoiceStrategyContext(
dynamicPool
)
+ expect(
+ workerChoiceStrategyContext.workerChoiceStrategies.get(
+ WorkerChoiceStrategies.ROUND_ROBIN
+ ).isDynamicPool
+ ).toBe(true)
expect(
workerChoiceStrategyContext.workerChoiceStrategies.get(
WorkerChoiceStrategies.ROUND_ROBIN
const workerChoiceStrategyContext = new WorkerChoiceStrategyContext(
fixedPool
)
+ expect(
+ workerChoiceStrategyContext.workerChoiceStrategies.get(
+ WorkerChoiceStrategies.LESS_USED
+ ).isDynamicPool
+ ).toBe(false)
workerChoiceStrategyContext.setWorkerChoiceStrategy(
WorkerChoiceStrategies.LESS_USED
)
const workerChoiceStrategyContext = new WorkerChoiceStrategyContext(
dynamicPool
)
+ expect(
+ workerChoiceStrategyContext.workerChoiceStrategies.get(
+ WorkerChoiceStrategies.LESS_USED
+ ).isDynamicPool
+ ).toBe(true)
workerChoiceStrategyContext.setWorkerChoiceStrategy(
WorkerChoiceStrategies.LESS_USED
)
const workerChoiceStrategyContext = new WorkerChoiceStrategyContext(
fixedPool
)
+ expect(
+ workerChoiceStrategyContext.workerChoiceStrategies.get(
+ WorkerChoiceStrategies.LESS_BUSY
+ ).isDynamicPool
+ ).toBe(false)
workerChoiceStrategyContext.setWorkerChoiceStrategy(
WorkerChoiceStrategies.LESS_BUSY
)
const workerChoiceStrategyContext = new WorkerChoiceStrategyContext(
dynamicPool
)
+ expect(
+ workerChoiceStrategyContext.workerChoiceStrategies.get(
+ WorkerChoiceStrategies.LESS_BUSY
+ ).isDynamicPool
+ ).toBe(true)
workerChoiceStrategyContext.setWorkerChoiceStrategy(
WorkerChoiceStrategies.LESS_BUSY
)
const workerChoiceStrategyContext = new WorkerChoiceStrategyContext(
fixedPool
)
+ expect(
+ workerChoiceStrategyContext.workerChoiceStrategies.get(
+ WorkerChoiceStrategies.FAIR_SHARE
+ ).isDynamicPool
+ ).toBe(false)
workerChoiceStrategyContext.setWorkerChoiceStrategy(
WorkerChoiceStrategies.FAIR_SHARE
)
const workerChoiceStrategyContext = new WorkerChoiceStrategyContext(
dynamicPool
)
+ expect(
+ workerChoiceStrategyContext.workerChoiceStrategies.get(
+ WorkerChoiceStrategies.FAIR_SHARE
+ ).isDynamicPool
+ ).toBe(true)
workerChoiceStrategyContext.setWorkerChoiceStrategy(
WorkerChoiceStrategies.FAIR_SHARE
)
const workerChoiceStrategyContext = new WorkerChoiceStrategyContext(
fixedPool
)
+ expect(
+ workerChoiceStrategyContext.workerChoiceStrategies.get(
+ WorkerChoiceStrategies.WEIGHTED_ROUND_ROBIN
+ ).isDynamicPool
+ ).toBe(false)
workerChoiceStrategyContext.setWorkerChoiceStrategy(
WorkerChoiceStrategies.WEIGHTED_ROUND_ROBIN
)
const workerChoiceStrategyContext = new WorkerChoiceStrategyContext(
dynamicPool
)
+ expect(
+ workerChoiceStrategyContext.workerChoiceStrategies.get(
+ WorkerChoiceStrategies.WEIGHTED_ROUND_ROBIN
+ ).isDynamicPool
+ ).toBe(true)
workerChoiceStrategyContext.setWorkerChoiceStrategy(
WorkerChoiceStrategies.WEIGHTED_ROUND_ROBIN
)