(err: Error)
| 211 | } |
| 212 | |
| 213 | private fail(err: Error): void { |
| 214 | if (!this.failed) this.failed = err; |
| 215 | for (const [, waiter] of this.waiters) waiter.reject(this.failed); |
| 216 | this.waiters.clear(); |
| 217 | for (const [, waiter] of this.synthWaiters) waiter.reject(this.failed); |
| 218 | this.synthWaiters.clear(); |
| 219 | // Pending recycles resolve rather than reject: their per-call timeout |
| 220 | // owns rejection, and the recycle caller checks this.failed next round. |
| 221 | for (const [, done] of this.recycleWaiters) done(); |
| 222 | this.recycleWaiters.clear(); |
| 223 | } |
| 224 | |
| 225 | /** Whether this batch is worth fanning out. */ |
| 226 | static worthParallel(batchLength: number): boolean { |
no test coverage detected