>
extends AbstractWorkerChoiceStrategy<Worker, Data, Response>
implements IWorkerChoiceStrategy<Worker, Data, Response> {
- /** {@inheritDoc} */
+ /** @inheritDoc */
public readonly requiredStatistics: RequiredStatistics = {
runTime: true,
avgRunTime: true
this.initWorkersTaskRunTime()
}
- /** {@inheritDoc} */
+ /** @inheritDoc */
public reset (): boolean {
this.currentWorkerId = 0
this.workersTaskRunTime.clear()
return true
}
- /** {@inheritDoc} */
+ /** @inheritDoc */
public choose (): number {
const chosenWorkerKey = this.currentWorkerId
if (this.isDynamicPool && !this.workersTaskRunTime.has(chosenWorkerKey)) {
return chosenWorkerKey
}
- /** {@inheritDoc} */
+ /** @inheritDoc */
public remove (workerKey: number): boolean {
if (this.currentWorkerId === workerKey) {
if (this.pool.workers.length === 0) {