| 837 | * @since 4.0.0 |
| 838 | */ |
| 839 | export class Protocol extends Context.Service< |
| 840 | Protocol, |
| 841 | { |
| 842 | readonly run: ( |
| 843 | f: (clientId: number, data: FromClientEncoded) => Effect.Effect<void> |
| 844 | ) => Effect.Effect<never> |
| 845 | readonly disconnects: Queue.Dequeue<number> |
| 846 | readonly send: ( |
| 847 | clientId: number, |
| 848 | response: FromServerEncoded, |
| 849 | transferables?: ReadonlyArray<globalThis.Transferable> |
| 850 | ) => Effect.Effect<void> |
| 851 | readonly end: (clientId: number) => Effect.Effect<void> |
| 852 | readonly clientIds: Effect.Effect<ReadonlySet<number>> |
| 853 | readonly initialMessage: Effect.Effect<Option.Option<unknown>> |
| 854 | readonly supportsAck: boolean |
| 855 | readonly supportsTransferables: boolean |
| 856 | readonly supportsSpanPropagation: boolean |
| 857 | } |
| 858 | >()("effect/rpc/RpcServer/Protocol") { |
| 859 | /** |
| 860 | * Creates a server protocol service from the supplied RPC implementation. |
| 861 | * |
| 862 | * @since 4.0.0 |
| 863 | */ |
| 864 | static make = withRun<Protocol["Service"]>() |
| 865 | } |
| 866 | |
| 867 | /** |
| 868 | * Creates a server `Protocol` backed by the current `SocketServer`, accepting |