this.sendToWorker(this.workerNodes[workerNodeKey].worker, task)
}
- private enqueueTask (workerNodeKey: number, task: Task<Data>): void {
- this.workerNodes[workerNodeKey].tasksQueue.push(task)
+ private enqueueTask (workerNodeKey: number, task: Task<Data>): number {
+ return this.workerNodes[workerNodeKey].tasksQueue.push(task)
}
private dequeueTask (workerNodeKey: number): Task<Data> | undefined {
protected readonly pool: IPoolInternal<Worker, Data, Response>,
protected readonly opts: WorkerChoiceStrategyOptions = { medRunTime: false }
) {
- this.checkOptions()
+ this.checkOptions(this.opts)
this.isDynamicPool = this.pool.type === PoolType.DYNAMIC
this.choose.bind(this)
}
- private checkOptions (): void {
- if (this.requiredStatistics.avgRunTime && this.opts.medRunTime === true) {
+ private checkOptions (opts: WorkerChoiceStrategyOptions): void {
+ if (this.requiredStatistics.avgRunTime && opts.medRunTime === true) {
this.requiredStatistics.medRunTime = true
}
}