(err: Error)
| 121 | } |
| 122 | |
| 123 | private failAll(err: Error): void { |
| 124 | if (!this.firstError) this.firstError = err; |
| 125 | for (const [, waiter] of this.drainWaiters) waiter.reject(this.firstError); |
| 126 | this.drainWaiters.clear(); |
| 127 | this.outstanding = 0; |
| 128 | const waiters = this.belowWaiters; |
| 129 | this.belowWaiters = []; |
| 130 | for (const w of waiters) w.resolve(); // send() will surface firstError |
| 131 | } |
| 132 | |
| 133 | private settleOne(): void { |
| 134 | if (this.outstanding > 0) this.outstanding--; |
no test coverage detected