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

Function onResponse

packages/effect/src/rpc/RpcClient.ts:1182–1190  ·  view source on GitHub ↗
(response: FromServerEncoded)

Source from the content-addressed store, hash-verified

1180 pending.add(String(requests[i].id))
1181 }
1182 const onResponse = (response: FromServerEncoded) => {
1183 if (response._tag === "Exit") {
1184 pending.delete(String(response.requestId))
1185 } else if (isTerminalResponse(response)) {
1186 // defects and protocol errors end every request of the client
1187 pending.clear()
1188 }
1189 return writeResponse(clientId, response)
1190 }
1191
1192 if (!isFramed) {
1193 const text = yield* response.text.pipe(Effect.mapError(httpClientError))

Callers 3

makeHttpExchangeFunction · 0.70
exchangeFunction · 0.50
inspectResponseFunction · 0.50

Calls 5

isTerminalResponseFunction · 0.90
writeResponseFunction · 0.85
deleteMethod · 0.65
clearMethod · 0.65
StringFunction · 0.50

Tested by

no test coverage detected