()
| 245 | } |
| 246 | |
| 247 | private async waitForAllExecutions(): Promise<void> { |
| 248 | await Promise.race([Promise.all(this.executing), this.abortPromise]) |
| 249 | if (this.executing.size > 0) { |
| 250 | await Promise.allSettled(this.executing) |
| 251 | } |
| 252 | } |
| 253 | |
| 254 | private async withQueueLock<T>(fn: () => Promise<T> | T): Promise<T> { |
| 255 | const prevLock = this.queueLock |