()
| 80 | } |
| 81 | |
| 82 | private async runInternal() { |
| 83 | assert( |
| 84 | !this.running, |
| 85 | 'Expected all other invocations to have finished' |
| 86 | ); |
| 87 | this.running = true; |
| 88 | this.timeoutId = undefined; |
| 89 | try { |
| 90 | await this.f(); |
| 91 | } finally { |
| 92 | this.running = false; |
| 93 | if (this.runAgain) { |
| 94 | this.runAgain = false; |
| 95 | this.schedule(); |
| 96 | } |
| 97 | } |
| 98 | } |
| 99 | } |