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

Function requestExit

packages/effect/src/rpc/RpcClient.ts:1233–1243  ·  view source on GitHub ↗
(
    request: RequestEncoded,
    pending: ReadonlySet<string> | undefined
  )

Source from the content-addressed store, hash-verified

1231
1232 // Completes one request from the result of the exchange that carried it.
1233 const requestExit = (
1234 request: RequestEncoded,
1235 pending: ReadonlySet<string> | undefined
1236 ): Exit.Exit<void, RpcClientError> => {
1237 if (pending === undefined) {
1238 return Exit.fail(protocolDefect("Received empty HTTP response from RPC server", request))
1239 } else if (pending.has(String(request.id))) {
1240 return Exit.fail(protocolDefect("HTTP response ended before RPC request completed", request))
1241 }
1242 return Exit.void
1243 }
1244
1245 const acknowledge = (clientId: number, request: RequestEncoded) => writeResponse(clientId, discardAck(request.id))
1246

Callers

nothing calls this directly

Calls 4

protocolDefectFunction · 0.85
failMethod · 0.65
hasMethod · 0.65
StringFunction · 0.50

Tested by

no test coverage detected