MCPcopy Create free account
hub / github.com/tiann/hapi / flush

Method flush

cli/src/claude/utils/OutgoingMessageQueue.ts:147–163  ·  view source on GitHub ↗

* Flush all messages immediately (for cleanup)

()

Source from the content-addressed store, hash-verified

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

Callers 2

runMainLoopMethod · 0.95

Calls 3

processQueueInternalMethod · 0.95
inLockMethod · 0.80
clearMethod · 0.80

Tested by

no test coverage detected