1import { WsRpcGroup } from "@t3tools/contracts";
2import * as Effect from "effect/Effect";
3import { RpcClient } from "effect/rpc";
4
5export const makeWsRpcProtocolClient = RpcClient.make(WsRpcGroup);
6type RpcClientFactory = typeof makeWsRpcProtocolClient;
7export type WsRpcProtocolClient =
8 RpcClientFactory extends Effect.Effect<infer Client, any, any> ? Client : never;
9
10// Pings go out every 5 seconds, and a server busy for a few seconds stops
11// answering them. Allow 15 seconds without any frame before dropping the socket.
12export const PING_TIMEOUT = "15 seconds";