()
| 39 | } |
| 40 | |
| 41 | private async runNext() { |
| 42 | if (this.running) return; |
| 43 | |
| 44 | const task = this.tasks.shift(); |
| 45 | if (!task) return; |
| 46 | |
| 47 | try { |
| 48 | await (this.running = task()); |
| 49 | } finally { |
| 50 | this.running = undefined; |
| 51 | } |
| 52 | |
| 53 | this.runNext(); |
| 54 | } |
| 55 | } |