/** {@inheritDoc} */
public choose (): Worker {
- const chosenWorker = this.pool.workers[this.nextWorkerId]?.worker
+ const chosenWorker = this.pool.workers[this.nextWorkerId].worker
this.nextWorkerId =
this.nextWorkerId === this.pool.workers.length - 1
? 0
/** {@inheritDoc} */
public choose (): Worker {
- const chosenWorker = this.pool.workers[this.currentWorkerId]?.worker
+ const chosenWorker = this.pool.workers[this.currentWorkerId].worker
if (this.isDynamicPool && !this.workersTaskRunTime.has(chosenWorker)) {
this.initWorkerTaskRunTime(chosenWorker)
}
? 0
: this.currentWorkerId + 1
this.setWorkerTaskRunTime(
- this.pool.workers[this.currentWorkerId]?.worker,
+ this.pool.workers[this.currentWorkerId].worker,
workerTaskWeight,
0
)