WorkerChoiceStrategies.ROUND_ROBIN
)
expect(
- pool.workerChoiceStrategyContext.getWorkerChoiceStrategy().nextWorkerIndex
+ pool.workerChoiceStrategyContext.getWorkerChoiceStrategy().nextWorkerId
).toBe(0)
// We need to clean up the resources after our test
await pool.destroy()
{ workerChoiceStrategy: WorkerChoiceStrategies.WEIGHTED_ROUND_ROBIN }
)
expect(
- pool.workerChoiceStrategyContext.getWorkerChoiceStrategy().nextWorkerIndex
+ pool.workerChoiceStrategyContext.getWorkerChoiceStrategy().nextWorkerId
).toBeUndefined()
pool.setWorkerChoiceStrategy(WorkerChoiceStrategies.ROUND_ROBIN)
expect(
- pool.workerChoiceStrategyContext.getWorkerChoiceStrategy().nextWorkerIndex
+ pool.workerChoiceStrategyContext.getWorkerChoiceStrategy().nextWorkerId
).toBe(0)
await pool.destroy()
pool = new DynamicThreadPool(
)
expect(
pool.workerChoiceStrategyContext.getWorkerChoiceStrategy()
- .workerChoiceStrategy.nextWorkerIndex
+ .workerChoiceStrategy.nextWorkerId
).toBeUndefined()
pool.setWorkerChoiceStrategy(WorkerChoiceStrategies.ROUND_ROBIN)
expect(
pool.workerChoiceStrategyContext.getWorkerChoiceStrategy()
- .workerChoiceStrategy.nextWorkerIndex
+ .workerChoiceStrategy.nextWorkerId
).toBe(0)
// We need to clean up the resources after our test
await pool.destroy()
WorkerChoiceStrategies.WEIGHTED_ROUND_ROBIN
)
expect(
- pool.workerChoiceStrategyContext.getWorkerChoiceStrategy()
- .currentWorkerIndex
+ pool.workerChoiceStrategyContext.getWorkerChoiceStrategy().currentWorkerId
).toBe(0)
expect(
pool.workerChoiceStrategyContext.getWorkerChoiceStrategy()
'./tests/worker-files/thread/testWorker.js'
)
expect(
- pool.workerChoiceStrategyContext.getWorkerChoiceStrategy()
- .currentWorkerIndex
+ pool.workerChoiceStrategyContext.getWorkerChoiceStrategy().currentWorkerId
).toBeUndefined()
expect(
pool.workerChoiceStrategyContext.getWorkerChoiceStrategy()
).toBeUndefined()
pool.setWorkerChoiceStrategy(WorkerChoiceStrategies.WEIGHTED_ROUND_ROBIN)
expect(
- pool.workerChoiceStrategyContext.getWorkerChoiceStrategy()
- .currentWorkerIndex
+ pool.workerChoiceStrategyContext.getWorkerChoiceStrategy().currentWorkerId
).toBe(0)
expect(
pool.workerChoiceStrategyContext.getWorkerChoiceStrategy()
)
expect(
pool.workerChoiceStrategyContext.getWorkerChoiceStrategy()
- .workerChoiceStrategy.currentWorkerIndex
+ .workerChoiceStrategy.currentWorkerId
).toBeUndefined()
expect(
pool.workerChoiceStrategyContext.getWorkerChoiceStrategy()
pool.setWorkerChoiceStrategy(WorkerChoiceStrategies.WEIGHTED_ROUND_ROBIN)
expect(
pool.workerChoiceStrategyContext.getWorkerChoiceStrategy()
- .workerChoiceStrategy.currentWorkerIndex
+ .workerChoiceStrategy.currentWorkerId
).toBe(0)
expect(
pool.workerChoiceStrategyContext.getWorkerChoiceStrategy()