(
entry: ClientRequestEntry,
write: (reply: FromServer<any>) => Effect.Effect<void>
)
| 1165 | const clientRespondDiscard = (_reply: Reply.Reply<any>) => Effect.void |
| 1166 | |
| 1167 | const makeClientRespond = ( |
| 1168 | entry: ClientRequestEntry, |
| 1169 | write: (reply: FromServer<any>) => Effect.Effect<void> |
| 1170 | ) => |
| 1171 | (reply: Reply.Reply<any>) => { |
| 1172 | switch (reply._tag) { |
| 1173 | case "Chunk": { |
| 1174 | entry.lastChunkId = reply.id |
| 1175 | return write({ |
| 1176 | _tag: "Chunk", |
| 1177 | clientId: 0, |
| 1178 | requestId: RequestId(reply.requestId), |
| 1179 | values: reply.values |
| 1180 | }) |
| 1181 | } |
| 1182 | case "WithExit": { |
| 1183 | clientRequests.delete(reply.requestId) |
| 1184 | return write({ |
| 1185 | _tag: "Exit", |
| 1186 | clientId: 0, |
| 1187 | requestId: RequestId(reply.requestId), |
| 1188 | exit: reply.exit |
| 1189 | }) |
| 1190 | } |
| 1191 | } |
| 1192 | } |
| 1193 | |
| 1194 | // --- Singletons --- |
| 1195 |
no test coverage detected