*/
protected internalBackPressure (): boolean {
return (
- this.opts.enableTasksQueue === true &&
this.workerNodes.reduce(
- (accumulator, workerNode) =>
- workerNode.info.ready && workerNode.info.backPressure
+ (accumulator, _, workerNodeKey) =>
+ this.isWorkerNodeBackPressured(workerNodeKey)
? accumulator + 1
: accumulator,
0
})
}
+ private isWorkerNodeBackPressured (workerNodeKey: number): boolean {
+ const workerNode = this.workerNodes[workerNodeKey]
+ return workerNode.info.ready && workerNode.info.backPressure
+ }
+
private isWorkerNodeBusy (workerNodeKey: number): boolean {
const workerNode = this.workerNodes[workerNodeKey]
if (this.opts.enableTasksQueue === true) {
}),
...(this.opts.enableTasksQueue === true && {
backPressureWorkerNodes: this.workerNodes.reduce(
- (accumulator, workerNode) =>
- workerNode.info.backPressure ? accumulator + 1 : accumulator,
+ (accumulator, _, workerNodeKey) =>
+ this.isWorkerNodeBackPressured(workerNodeKey)
+ ? accumulator + 1
+ : accumulator,
0
),
}),