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

Function makeClientRespond

packages/cluster/src/Sharding.ts:1388–1413  ·  view source on GitHub ↗
(
    entry: ClientRequestEntry,
    write: (reply: FromServer<any>) => Effect.Effect<void>
  )

Source from the content-addressed store, hash-verified

1386 const clientRespondDiscard = (_reply: Reply.Reply<any>) => Effect.void
1387
1388 const makeClientRespond = (
1389 entry: ClientRequestEntry,
1390 write: (reply: FromServer<any>) => Effect.Effect<void>
1391 ) =>
1392 (reply: Reply.Reply<any>) => {
1393 switch (reply._tag) {
1394 case "Chunk": {
1395 entry.lastChunkId = reply.id
1396 return write({
1397 _tag: "Chunk",
1398 clientId: 0,
1399 requestId: RequestId(reply.requestId),
1400 values: reply.values
1401 })
1402 }
1403 case "WithExit": {
1404 clientRequests.delete(reply.requestId)
1405 return write({
1406 _tag: "Exit",
1407 clientId: 0,
1408 requestId: RequestId(reply.requestId),
1409 exit: reply.exit
1410 })
1411 }
1412 }
1413 }
1414
1415 // --- Singletons ---
1416

Callers 1

onFromClientFunction · 0.85

Calls 2

RequestIdFunction · 0.90
writeFunction · 0.50

Tested by

no test coverage detected