MCPcopy Create free account
hub / github.com/Effect-TS/effect / layerProtocolSocket

Function layerProtocolSocket

packages/effect/src/unstable/rpc/RpcClient.ts:1199–1212  ·  view source on GitHub ↗
(options?: {
  readonly retryTransientErrors?: boolean | undefined
  /**
   * Runs for each retried `SocketOpenError` when `retryTransientErrors` is enabled.
   * Ping timeouts are also reported because the protocol classifies them as
   * `SocketOpenError`. The returned `Effect<void>` cannot fail with a typed error
   * or require services; defects are logged and ignored so retries can continue.
   */
  readonly onTransientError?: ((error: RpcClientError) => Effect.Effect<void>) | undefined
})

Source from the content-addressed store, hash-verified

1197 * @since 4.0.0
1198 */
1199export const layerProtocolSocket = (options?: {
1200 readonly retryTransientErrors?: boolean | undefined
1201 /**
1202 * Runs for each retried `SocketOpenError` when `retryTransientErrors` is enabled.
1203 * Ping timeouts are also reported because the protocol classifies them as
1204 * `SocketOpenError`. The returned `Effect<void>` cannot fail with a typed error
1205 * or require services; defects are logged and ignored so retries can continue.
1206 */
1207 readonly onTransientError?: ((error: RpcClientError) => Effect.Effect<void>) | undefined
1208}): Layer.Layer<
1209 Protocol,
1210 never,
1211 Socket.Socket | RpcSerialization.RpcSerialization
1212> => Layer.effect(Protocol)(makeProtocolSocket(options))
1213
1214/**
1215 * Creates a client `Protocol` backed by a pool of workers, routing RPC requests

Callers

nothing calls this directly

Calls 1

makeProtocolSocketFunction · 0.85

Tested by

no test coverage detected