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