(client: Client, defect: unknown)
| 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, |
no test coverage detected