MCPcopy
hub / github.com/Effect-TS/effect / sendDefect

Function sendDefect

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

Source from the content-addressed store, hash-verified

403 }
404
405 const sendDefect = (client: Client, defect: unknown) =>
406 Effect.suspend(() => {
407 const shouldEnd = client.ended && client.fibers.size === 0
408 const write = options.onFromServer({
409 _tag: "Defect",
410 clientId: client.id,
411 defect
412 })
413 if (!shouldEnd) return write
414 return Effect.zipRight(write, endClient(client))
415 })
416
417 return identity<RpcServer<Rpcs>>({
418 write,

Callers 5

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

Calls 2

endClientFunction · 0.85
sendFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…