repositories
/
poolifier.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
test: code cleanup
[poolifier.git]
/
src
/
pools
/
selection-strategies
/
abstract-worker-choice-strategy.ts
diff --git
a/src/pools/selection-strategies/abstract-worker-choice-strategy.ts
b/src/pools/selection-strategies/abstract-worker-choice-strategy.ts
index 75c7450d8ccc5f8b73d74b5404f4410f4376a46e..f1d7dcf405b2e565f150137aa87e4cab1a79bd6d 100644
(file)
--- a/
src/pools/selection-strategies/abstract-worker-choice-strategy.ts
+++ b/
src/pools/selection-strategies/abstract-worker-choice-strategy.ts
@@
-116,6
+116,11
@@
export abstract class AbstractWorkerChoiceStrategy<
this.setTaskStatisticsRequirements(this.opts)
}
this.setTaskStatisticsRequirements(this.opts)
}
+ /** @inheritDoc */
+ public hasPoolWorkerNodesReady (): boolean {
+ return this.pool.workerNodes.some(workerNode => workerNode.info.ready)
+ }
+
/**
* Whether the worker node is ready or not.
*
/**
* Whether the worker node is ready or not.
*
@@
-123,17
+128,16
@@
export abstract class AbstractWorkerChoiceStrategy<
* @returns Whether the worker node is ready or not.
*/
protected isWorkerNodeReady (workerNodeKey: number): boolean {
* @returns Whether the worker node is ready or not.
*/
protected isWorkerNodeReady (workerNodeKey: number): boolean {
- return this.pool.workerNodes[workerNodeKey]?.info.ready ?? false
+ return this.pool.workerNodes[workerNodeKey]?.info
?
.ready ?? false
}
/**
}
/**
- * Whether the worker node has back pressure or not (i.e. its tasks queue is full).
- *
- * @param workerNodeKey - The worker node key.
- * @returns `true` if the worker node has back pressure, `false` otherwise.
+ * Check the next worker node readiness.
*/
*/
- protected hasWorkerNodeBackPressure (workerNodeKey: number): boolean {
- return this.pool.hasWorkerNodeBackPressure(workerNodeKey)
+ protected checkNextWorkerNodeReadiness (): void {
+ if (!this.isWorkerNodeReady(this.nextWorkerNodeKey as number)) {
+ delete this.nextWorkerNodeKey
+ }
}
/**
}
/**