X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fpools%2Fselection-strategies%2Fless-busy-worker-choice-strategy.ts;h=c03c9da0a1580ce645b96df5bf24b44111aa080a;hb=15e5141f463661f3dd0f17e8a9402703fddd4050;hp=87ee1ef88f16714d4271a5ba671686d122667f35;hpb=c6bd2650c2690bd84951a2278820adde1b05b41b;p=poolifier.git diff --git a/src/pools/selection-strategies/less-busy-worker-choice-strategy.ts b/src/pools/selection-strategies/less-busy-worker-choice-strategy.ts index 87ee1ef8..c03c9da0 100644 --- a/src/pools/selection-strategies/less-busy-worker-choice-strategy.ts +++ b/src/pools/selection-strategies/less-busy-worker-choice-strategy.ts @@ -14,26 +14,27 @@ import type { */ export class LessBusyWorkerChoiceStrategy< Worker extends IPoolWorker, - Data, - Response + Data = unknown, + Response = unknown > extends AbstractWorkerChoiceStrategy implements IWorkerChoiceStrategy { - /** {@inheritDoc} */ + /** @inheritDoc */ public readonly requiredStatistics: RequiredStatistics = { runTime: true, - avgRunTime: false + avgRunTime: false, + medRunTime: 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 @@ -50,7 +51,7 @@ export class LessBusyWorkerChoiceStrategy< return lessBusyWorkerKey } - /** {@inheritDoc} */ + /** @inheritDoc */ public remove (workerKey: number): boolean { return true }