MCPcopy Index your code
hub / github.com/claude-code-best/claude-code / enqueueWrite

Method enqueueWrite

src/utils/sessionStorage.ts:613–630  ·  view source on GitHub ↗
(filePath: string, entry: Entry)

Source from the content-addressed store, hash-verified

611 }
612
613 private enqueueWrite(filePath: string, entry: Entry): Promise<void> {
614 return new Promise<void>(resolve => {
615 let queue = this.writeQueues.get(filePath)
616 if (!queue) {
617 queue = []
618 this.writeQueues.set(filePath, queue)
619 }
620 // Drop oldest entries when queue exceeds limit to prevent unbounded memory growth
621 if (queue.length >= 1000) {
622 const dropped = queue.splice(0, queue.length - 999)
623 for (const d of dropped) {
624 d.resolve()
625 }
626 }
627 queue.push({ entry, resolve })
628 this.scheduleDrain()
629 })
630 }
631
632 private scheduleDrain(): void {
633 if (this.flushTimer) {

Callers 1

appendEntryMethod · 0.95

Calls 5

scheduleDrainMethod · 0.95
setMethod · 0.80
getMethod · 0.65
resolveMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected