MCPcopy Create free account
hub / github.com/Effect-TS/effect / writeNext

Function writeNext

packages/platform/node/test/NodeHttpServer.test.ts:2816–2821  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2814 // Pause between parts so the server reads them separately.
2815 const parts = typeof input === "string" ? [input] : [...input]
2816 const writeNext = () => {
2817 const part = parts.shift()!
2818 if (parts.length === 0) return socket.end(part)
2819 socket.write(part)
2820 setTimeout(writeNext, 50)
2821 }
2822 socket.on("connect", writeNext)
2823 socket.on("data", (data) => {
2824 stream = Buffer.Buffer.concat([stream, Buffer.Buffer.from(data)])

Callers

nothing calls this directly

Calls 2

endMethod · 0.65
writeMethod · 0.65

Tested by

no test coverage detected