pool
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
/** {@inheritDoc} */
public choose (): number {
+ const freeWorkerKey = this.pool.findFreeWorkerKey()
+ if (!this.isDynamicPool && freeWorkerKey !== false) {
+ return freeWorkerKey
+ }
let minRunTime = Infinity
let lessBusyWorkerKey!: number
for (const [index, workerItem] of this.pool.workers.entries()) {
/** {@inheritDoc} */
public choose (): number {
+ const freeWorkerKey = this.pool.findFreeWorkerKey()
+ if (!this.isDynamicPool && freeWorkerKey !== false) {
+ return freeWorkerKey
+ }
let minNumberOfTasks = Infinity
let lessUsedWorkerKey!: number
for (const [index, workerItem] of this.pool.workers.entries()) {