*/
export class LessBusyWorkerChoiceStrategy<
Worker extends IPoolWorker,
- Data,
- Response
+ Data = unknown,
+ Response = unknown
>
extends AbstractWorkerChoiceStrategy<Worker, Data, Response>
implements IWorkerChoiceStrategy {
- /** {@inheritDoc} */
+ /** @inheritDoc */
public readonly requiredStatistics: RequiredStatistics = {
runTime: true,
avgRunTime: false
}
- /** {@inheritDoc} */
+ /** @inheritDoc */
public reset (): boolean {
return true
}
- /** {@inheritDoc} */
+ /** @inheritDoc */
public choose (): number {
const freeWorkerKey = this.pool.findFreeWorkerKey()
- if (!this.isDynamicPool && freeWorkerKey !== -1) {
+ if (freeWorkerKey !== -1) {
return freeWorkerKey
}
let minRunTime = Infinity
return lessBusyWorkerKey
}
- /** {@inheritDoc} */
+ /** @inheritDoc */
public remove (workerKey: number): boolean {
return true
}