* Returns a promise that resolves once all currently-enqueued tasks (including * any tasks they enqueue during execution) have completed. * * If the queue is idle, resolves immediately.
()
| 44 | * If the queue is idle, resolves immediately. |
| 45 | */ |
| 46 | async waitUntilDone(): Promise<void> { |
| 47 | let snapshot: Promise<void>; |
| 48 | do { |
| 49 | snapshot = this.tail; |
| 50 | await snapshot; |
| 51 | } while (snapshot !== this.tail); |
| 52 | } |
| 53 | |
| 54 | /** |
| 55 | * Stop the queue. Pending tasks are skipped and future `enqueue()` calls are |
no outgoing calls
no test coverage detected