()
| 839 | } |
| 840 | |
| 841 | async flush(): Promise<void> { |
| 842 | // Cancel pending timer |
| 843 | if (this.flushTimer) { |
| 844 | clearTimeout(this.flushTimer) |
| 845 | this.flushTimer = null |
| 846 | } |
| 847 | // Wait for any in-flight drain to finish |
| 848 | if (this.activeDrain) { |
| 849 | await this.activeDrain |
| 850 | } |
| 851 | // Drain anything remaining in the queues |
| 852 | await this.drainWriteQueue() |
| 853 | |
| 854 | // Wait for non-queue tracked operations (e.g. removeMessageByUuid) |
| 855 | if (this.pendingWriteCount === 0) { |
| 856 | return |
| 857 | } |
| 858 | return new Promise<void>(resolve => { |
| 859 | this.flushResolvers.push(resolve) |
| 860 | }) |
| 861 | } |
| 862 | |
| 863 | /** |
| 864 | * Remove a message from the transcript by UUID. |
no test coverage detected