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

Function sendDefect

packages/effect/src/rpc/RpcServer.ts:513–523  ·  view source on GitHub ↗
(client: Client, defect: unknown)

Source from the content-addressed store, hash-verified

511 }
512
513 const sendDefect = (client: Client, defect: unknown) =>
514 Effect.suspend(() => {
515 const shouldEnd = client.ended && client.fibers.size === 0
516 const write = options.onFromServer({
517 _tag: "Defect",
518 clientId: client.id,
519 defect
520 })
521 if (!shouldEnd) return write
522 return Effect.andThen(write, endClient(client))
523 })
524
525 return identity<RpcServer<Rpcs>>({
526 write,

Callers 6

writeFunction · 0.85
handleRequestFunction · 0.85
onFromServerFunction · 0.85
sendRequestDefectFunction · 0.85
replyFunction · 0.85
RpcServer.tsFile · 0.85

Calls 3

ResponseDefectEncodedFunction · 0.90
endClientFunction · 0.85
sendFunction · 0.70

Tested by

no test coverage detected