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

Function sendDefect

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

Source from the content-addressed store, hash-verified

444 }
445
446 const sendDefect = (client: Client, defect: unknown) =>
447 Effect.suspend(() => {
448 const shouldEnd = client.ended && client.fibers.size === 0
449 const write = options.onFromServer({
450 _tag: "Defect",
451 clientId: client.id,
452 defect
453 })
454 if (!shouldEnd) return write
455 return Effect.andThen(write, endClient(client))
456 })
457
458 return identity<RpcServer<Rpcs>>({
459 write,

Callers 5

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

Calls 3

ResponseDefectEncodedFunction · 0.90
endClientFunction · 0.85
sendFunction · 0.70

Tested by

no test coverage detected