MCPcopy Index your code
hub / github.com/vercel/hyper / write

Method write

app/session.ts:59–74  ·  view source on GitHub ↗
(chunk: Buffer)

Source from the content-addressed store, hash-verified

57 }
58
59 write(chunk: Buffer) {
60 if (this.data.length + chunk.length >= BATCH_MAX_SIZE) {
61 // We've reached the max batch size. Flush it and start another one
62 if (this.timeout) {
63 clearTimeout(this.timeout);
64 this.timeout = null;
65 }
66 this.flush();
67 }
68
69 this.data += this.decoder.write(chunk);
70
71 if (!this.timeout) {
72 this.timeout = setTimeout(() => this.flush(), BATCH_DURATION_MS);
73 }
74 }
75
76 flush() {
77 // Reset before emitting to allow for potential reentrancy

Callers

nothing calls this directly

Calls 2

flushMethod · 0.95
writeMethod · 0.45

Tested by

no test coverage detected