X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fpools%2Fselection-strategies%2Fround-robin-worker-choice-strategy.ts;h=0995b3506b102931ab59956a927a51f0aa5fbbbc;hb=d33be4309c69e39da5e81479e40b1a5ec7078bd5;hp=be4fe3326b9585c8bd4f7261023cda4fe5af710e;hpb=49be33feded000ed776ee589274e154fa519b263;p=poolifier.git diff --git a/src/pools/selection-strategies/round-robin-worker-choice-strategy.ts b/src/pools/selection-strategies/round-robin-worker-choice-strategy.ts index be4fe332..0995b350 100644 --- a/src/pools/selection-strategies/round-robin-worker-choice-strategy.ts +++ b/src/pools/selection-strategies/round-robin-worker-choice-strategy.ts @@ -4,6 +4,7 @@ import type { IWorker } from '../worker' import { AbstractWorkerChoiceStrategy } from './abstract-worker-choice-strategy' import type { IWorkerChoiceStrategy, + StrategyPolicy, WorkerChoiceStrategyOptions } from './selection-strategies-types' @@ -21,10 +22,10 @@ export class RoundRobinWorkerChoiceStrategy< > extends AbstractWorkerChoiceStrategy implements IWorkerChoiceStrategy { - /** - * Id of the next worker node. - */ - private nextWorkerNodeId: number = 0 + /** @inheritDoc */ + public readonly strategyPolicy: StrategyPolicy = { + useDynamicWorker: true + } /** @inheritDoc */ public constructor ( @@ -32,7 +33,7 @@ export class RoundRobinWorkerChoiceStrategy< opts: WorkerChoiceStrategyOptions = DEFAULT_WORKER_CHOICE_STRATEGY_OPTIONS ) { super(pool, opts) - this.setRequiredStatistics(this.opts) + this.setTaskStatisticsRequirements(this.opts) } /** @inheritDoc */