(client: HttpClient.HttpClient)
| 987 | > => options?.batch ? makeProtocolHttpBatched(client, options.batch) : makeProtocolHttpUnbatched(client) |
| 988 | |
| 989 | const makeProtocolHttpUnbatched = (client: HttpClient.HttpClient) => |
| 990 | Protocol.make(Effect.fnUntraced(function*(writeResponse) { |
| 991 | const serialization = yield* RpcSerialization.RpcSerialization |
| 992 | const exchange = makeHttpExchange(client, serialization, writeResponse) |
| 993 | return { |
| 994 | send: (clientId, request) => { |
| 995 | if (request._tag !== "Request") return Effect.void |
| 996 | return Effect.flatMap( |
| 997 | exchange.send(clientId, [request]), |
| 998 | (pending) => |
| 999 | exchange.isNotification(request) |
| 1000 | ? exchange.acknowledge(clientId, request) |
| 1001 | : exchange.requestExit(request, pending) |
| 1002 | ) |
| 1003 | }, |
| 1004 | supportsAck: false, |
| 1005 | supportsTransferables: false, |
| 1006 | codecFor: serialization.codecFor |
| 1007 | } |
| 1008 | })) |
| 1009 | |
| 1010 | const withBatchSpan = <A, E, R>(effect: Effect.Effect<A, E, R>, requests: ReadonlyArray<RequestEncoded>) => { |
| 1011 | const links: Array<Tracer.SpanLink> = [] |
no test coverage detected