*/
protected nextWorkerNodeKey: number | undefined = 0
+ /**
+ * The previous worker node key.
+ */
+ protected previousWorkerNodeKey: number = 0
+
/** @inheritDoc */
public readonly strategyPolicy: StrategyPolicy = {
dynamicWorkerUsage: false,
- dynamicWorkerReady: false
+ dynamicWorkerReady: true
}
/** @inheritDoc */
}
}
+ protected resetWorkerNodeKeyProperties (): void {
+ this.nextWorkerNodeKey = 0
+ this.previousWorkerNodeKey = 0
+ }
+
/** @inheritDoc */
public abstract reset (): boolean
}
/**
- * Assign to nextWorkerNodeKey property the chosen worker node key.
+ * Check the next worker node eligibility.
*
* @param chosenWorkerNodeKey - The chosen worker node key.
*/
- protected assignChosenWorkerNodeKey (
+ protected checkNextWorkerNodeEligibility (
chosenWorkerNodeKey: number | undefined
): void {
- if (chosenWorkerNodeKey != null) {
- this.nextWorkerNodeKey = chosenWorkerNodeKey
- } else {
+ if (!this.isWorkerNodeEligible(this.nextWorkerNodeKey as number)) {
this.nextWorkerNodeKey = undefined
+ this.previousWorkerNodeKey =
+ chosenWorkerNodeKey ?? this.previousWorkerNodeKey
}
}