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

Function layerHttp

packages/effect/src/unstable/rpc/RpcServer.ts:800–824  ·  view source on GitHub ↗
(options: {
  readonly group: RpcGroup.RpcGroup<Rpcs>
  readonly path: HttpRouter.PathInput
  readonly protocol?: "http" | "websocket" | undefined
  readonly disableTracing?: boolean | undefined
  readonly spanPrefix?: string | undefined
  readonly spanAttributes?: Record<string, unknown> | undefined
  readonly concurrency?: number | "unbounded" | undefined
  readonly disableFatalDefects?: boolean | undefined
})

Source from the content-addressed store, hash-verified

798 * @since 4.0.0
799 */
800export const layerHttp = <Rpcs extends Rpc.Any>(options: {
801 readonly group: RpcGroup.RpcGroup<Rpcs>
802 readonly path: HttpRouter.PathInput
803 readonly protocol?: "http" | "websocket" | undefined
804 readonly disableTracing?: boolean | undefined
805 readonly spanPrefix?: string | undefined
806 readonly spanAttributes?: Record<string, unknown> | undefined
807 readonly concurrency?: number | "unbounded" | undefined
808 readonly disableFatalDefects?: boolean | undefined
809}): Layer.Layer<
810 never,
811 never,
812 | RpcSerialization.RpcSerialization
813 | HttpRouter.HttpRouter
814 | Rpc.ToHandler<Rpcs>
815 | Rpc.Middleware<Rpcs>
816 | Rpc.ServicesServer<Rpcs>
817> =>
818 layer(options.group, options).pipe(
819 Layer.provide(
820 options.protocol === "http"
821 ? layerProtocolHttp(options)
822 : layerProtocolWebsocket(options)
823 )
824 )
825
826/**
827 * Defines the service interface for an RPC server transport, responsible for receiving

Callers

nothing calls this directly

Calls 5

layerProtocolWebsocketFunction · 0.85
layerFunction · 0.70
layerProtocolHttpFunction · 0.70
pipeMethod · 0.65
provideMethod · 0.45

Tested by

no test coverage detected