(request: typeof ProtocolRequest.Type)
| 262 | const writeRaw = yield* socket.writer |
| 263 | |
| 264 | function* writeGen(request: typeof ProtocolRequest.Type) { |
| 265 | const data = encodeRequest(request) |
| 266 | if (request._tag !== "WriteEntries" || data.byteLength <= constChunkSize) { |
| 267 | return yield* writeRaw(data) |
| 268 | } |
| 269 | const id = request.id |
| 270 | for (const part of ChunkedMessage.split(id, data)) { |
| 271 | yield* writeRaw(encodeRequest(part)) |
| 272 | } |
| 273 | } |
| 274 | |
| 275 | const write = (request: typeof ProtocolRequest.Type) => Effect.gen(() => writeGen(request)) |
| 276 |