*/
public constructor (
protected readonly pool: IPool<Worker, Data, Response>,
- protected readonly opts: WorkerChoiceStrategyOptions = DEFAULT_WORKER_CHOICE_STRATEGY_OPTIONS
+ protected opts: WorkerChoiceStrategyOptions = DEFAULT_WORKER_CHOICE_STRATEGY_OPTIONS
) {
this.isDynamicPool = this.pool.type === PoolType.DYNAMIC
this.choose.bind(this)
this.requiredStatistics.avgRunTime = false
this.requiredStatistics.medRunTime = opts.medRunTime as boolean
}
+ if (this.requiredStatistics.medRunTime && opts.medRunTime === false) {
+ this.requiredStatistics.avgRunTime = true
+ this.requiredStatistics.medRunTime = opts.medRunTime as boolean
+ }
}
/** @inheritDoc */
/** @inheritDoc */
public abstract remove (workerNodeKey: number): boolean
+
+ /** @inheritDoc */
+ public setOptions (opts: WorkerChoiceStrategyOptions): void {
+ this.checkOptions(opts)
+ this.opts = opts
+ }
}