MCPcopy
hub / github.com/codeaashu/claude-code / push

Method push

web/lib/performance/streaming-optimizer.ts:19–36  ·  view source on GitHub ↗
(chunk: string)

Source from the content-addressed store, hash-verified

17 }
18
19 push(chunk: string): void {
20 this.buffer += chunk;
21
22 if (this.rafId !== null) return; // rAF already scheduled
23
24 const now = performance.now();
25 const timeSinceLast = now - this.lastFlushTime;
26
27 if (timeSinceLast >= this.maxDelay) {
28 // Flush is overdue — do it synchronously to avoid latency buildup
29 this.flush();
30 } else {
31 this.rafId = requestAnimationFrame(() => {
32 this.rafId = null;
33 this.flush();
34 });
35 }
36 }
37
38 flush(): void {
39 if (!this.buffer) return;

Callers 15

webpackFunction · 0.45
SearchBarFunction · 0.45
UnifiedDiffFunction · 0.45
SideBySideDiffFunction · 0.45
parseGrepOutputFunction · 0.45
pushSegmentFunction · 0.45
CursorGhostFunction · 0.45
captureKeyComboFunction · 0.45
CommandPaletteFunction · 0.45
pushFunction · 0.45
ansiToHtmlFunction · 0.45
ensureSlotsMethod · 0.45

Calls 1

flushMethod · 0.95

Tested by

no test coverage detected