()
| 29 | } |
| 30 | |
| 31 | private execNextTask() { |
| 32 | if (this.queue.length < 1) { |
| 33 | this.executing = false; |
| 34 | return; |
| 35 | } |
| 36 | this.executing = true; |
| 37 | const task = this.queue.shift() as Task; |
| 38 | task.fn().then(() => { |
| 39 | this.execNextTask(); |
| 40 | }); |
| 41 | } |
| 42 | } |