* Flush all messages immediately (for cleanup)
()
| 145 | * Flush all messages immediately (for cleanup) |
| 146 | */ |
| 147 | async flush(): Promise<void> { |
| 148 | await this.lock.inLock(async () => { |
| 149 | // Clear all delay timers |
| 150 | for (const timer of this.delayTimers.values()) { |
| 151 | clearTimeout(timer); |
| 152 | } |
| 153 | this.delayTimers.clear(); |
| 154 | |
| 155 | // Mark all as released |
| 156 | for (const item of this.queue) { |
| 157 | item.released = true; |
| 158 | } |
| 159 | |
| 160 | // Process everything - use internal method since we already have the lock |
| 161 | this.processQueueInternal(); |
| 162 | }); |
| 163 | } |
| 164 | |
| 165 | /** |
| 166 | * Schedule processing on next tick |
no test coverage detected