* Worker choice strategy abstract base class.
*
* @typeParam Worker - Type of worker which manages the strategy.
- * @typeParam Data - Type of data sent to the worker. This can only be serializable data.
- * @typeParam Response - Type of execution response. This can only be serializable data.
+ * @typeParam Data - Type of data sent to the worker. This can only be structured-cloneable data.
+ * @typeParam Response - Type of execution response. This can only be structured-cloneable data.
*/
export abstract class AbstractWorkerChoiceStrategy<
Worker extends IWorker,
/** @inheritDoc */
public setOptions (opts: WorkerChoiceStrategyOptions): void {
- opts = opts ?? DEFAULT_WORKER_CHOICE_STRATEGY_OPTIONS
- this.setTaskStatisticsRequirements(opts)
- this.opts = opts
+ this.opts = opts ?? DEFAULT_WORKER_CHOICE_STRATEGY_OPTIONS
+ this.setTaskStatisticsRequirements(this.opts)
}
// /**
*/
protected getWorkerTaskWaitTime (workerNodeKey: number): number {
return this.taskStatisticsRequirements.waitTime.median
- ? this.pool.workerNodes[workerNodeKey].workerUsage.runTime.median
- : this.pool.workerNodes[workerNodeKey].workerUsage.runTime.average
+ ? this.pool.workerNodes[workerNodeKey].workerUsage.waitTime.median
+ : this.pool.workerNodes[workerNodeKey].workerUsage.waitTime.average
}
/**