X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;ds=sidebyside;f=src%2Fpools%2Fselection-strategies%2Fabstract-worker-choice-strategy.ts;h=d4fcd8d0a95bae029d23ef386fd7cbd2d17a7dde;hb=e2b31e32498626103ef3c737bdffb285087b13e6;hp=9c20c5bea63143f3b3e556f2629b635026e32a2a;hpb=57441b795f8680adcdfe1a58882d54fb41cce970;p=poolifier.git diff --git a/src/pools/selection-strategies/abstract-worker-choice-strategy.ts b/src/pools/selection-strategies/abstract-worker-choice-strategy.ts index 9c20c5be..d4fcd8d0 100644 --- a/src/pools/selection-strategies/abstract-worker-choice-strategy.ts +++ b/src/pools/selection-strategies/abstract-worker-choice-strategy.ts @@ -114,6 +114,16 @@ export abstract class AbstractWorkerChoiceStrategy< return this.pool.workerNodes[workerNodeKey].info.ready } + /** + * 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. + */ + protected hasWorkerNodeBackPressure (workerNodeKey: number): boolean { + return this.pool.hasWorkerNodeBackPressure(workerNodeKey) + } + /** * Gets the worker task runtime. * If the task statistics require the average runtime, the average runtime is returned.