()
| 885 | } |
| 886 | |
| 887 | async flush(): Promise<void> { |
| 888 | // Cancel pending timer |
| 889 | if (this.flushTimer) { |
| 890 | clearTimeout(this.flushTimer) |
| 891 | this.flushTimer = null |
| 892 | } |
| 893 | // Wait for any in-flight drain to finish |
| 894 | if (this.activeDrain) { |
| 895 | await this.activeDrain |
| 896 | } |
| 897 | // Drain anything remaining in the queues |
| 898 | await this.drainWriteQueue() |
| 899 | |
| 900 | // Wait for non-queue tracked operations (e.g. removeMessageByUuid) |
| 901 | if (this.pendingWriteCount === 0) { |
| 902 | return |
| 903 | } |
| 904 | return new Promise<void>(resolve => { |
| 905 | this.flushResolvers.push(resolve) |
| 906 | }) |
| 907 | } |
| 908 | |
| 909 | /** |
| 910 | * Remove a message from the transcript by UUID. |
no test coverage detected