MCPcopy Index your code
hub / github.com/Effect-TS/effect / writeGen

Function writeGen

packages/experimental/src/EventLogServer.ts:51–60  ·  view source on GitHub ↗
(response: typeof ProtocolResponse.Type)

Source from the content-addressed store, hash-verified

49 let latestSequence = -1
50
51 function* writeGen(response: typeof ProtocolResponse.Type) {
52 const data = encodeResponse(response)
53 if (response._tag !== "Changes" || data.byteLength <= constChunkSize) {
54 return yield* writeRaw(data)
55 }
56 const id = chunkId++
57 for (const part of ChunkedMessage.split(id, data)) {
58 yield* writeRaw(encodeResponse(part))
59 }
60 }
61 const write = (response: typeof ProtocolResponse.Type) => Effect.gen(() => writeGen(response))
62
63 yield* Effect.fork(write(new Hello({ remoteId })))

Callers 1

writeFunction · 0.70

Calls 1

splitMethod · 0.80

Tested by

no test coverage detected