()
| 131 | } |
| 132 | |
| 133 | private settleOne(): void { |
| 134 | if (this.outstanding > 0) this.outstanding--; |
| 135 | if (this.belowWaiters.length === 0) return; |
| 136 | const still: typeof this.belowWaiters = []; |
| 137 | for (const w of this.belowWaiters) { |
| 138 | if (this.outstanding < w.limit) w.resolve(); |
| 139 | else still.push(w); |
| 140 | } |
| 141 | this.belowWaiters = still; |
| 142 | } |
| 143 | |
| 144 | ready(): Promise<void> { |
| 145 | return this.readyPromise; |