()
| 264 | } |
| 265 | |
| 266 | flushQueue() { |
| 267 | while (this.activeRequestCount < this.maxConcurrentRequests && this.requestQueue.length > 0) { |
| 268 | const next = this.requestQueue.shift(); |
| 269 | if (typeof next === 'function') { |
| 270 | next(); |
| 271 | } |
| 272 | } |
| 273 | } |
| 274 | |
| 275 | sleep(ms) { |
| 276 | return new Promise((resolve) => setTimeout(resolve, ms)); |