opts: WorkerChoiceStrategyOptions = DEFAULT_WORKER_CHOICE_STRATEGY_OPTIONS
) {
super(pool, opts)
- this.checkOptions(this.opts)
+ this.setRequiredStatistics(this.opts)
}
/** @inheritDoc */
return true
}
+ /** @inheritDoc */
+ public update (): boolean {
+ return true
+ }
+
/** @inheritDoc */
public choose (): number {
const chosenWorkerNodeKey = this.nextWorkerNodeId
if (this.nextWorkerNodeId === workerNodeKey) {
if (this.pool.workerNodes.length === 0) {
this.nextWorkerNodeId = 0
- } else {
- this.nextWorkerNodeId =
- this.nextWorkerNodeId > this.pool.workerNodes.length - 1
- ? this.pool.workerNodes.length - 1
- : this.nextWorkerNodeId
+ } else if (this.nextWorkerNodeId > this.pool.workerNodes.length - 1) {
+ this.nextWorkerNodeId = this.pool.workerNodes.length - 1
}
}
return true