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