NodeClusterHttp.ts
NodeClusterHttp.ts overview
Section titled “NodeClusterHttp.ts overview”Node.js HTTP and WebSocket layers for Effect Cluster runners.
The main layer builds a sharding layer for HTTP or WebSocket transport,
choosing serialization, runner health checks, runner storage, message
storage, and optional client-only mode from the supplied options.
layerHttpServer provides the Node HTTP server used by cluster runners, and
this module re-exports the Kubernetes HTTP client layer used by runner health
checks.
Since v4.0.0
Exports Grouped by Category
Section titled “Exports Grouped by Category”layers
Section titled “layers”Builds the Node cluster HTTP/WebSocket sharding layer, configuring runner transport, RPC serialization, message storage, runner health checks, and optional client-only mode.
Signature
declare const layer: < const ClientOnly extends boolean = false, const Storage extends "local" | "sql" | "byo" = never>(options: { readonly transport: "http" | "websocket" readonly serialization?: "msgpack" | "ndjson" | undefined readonly clientOnly?: ClientOnly | undefined readonly storage?: Storage | undefined readonly runnerHealth?: "ping" | "k8s" | undefined readonly runnerHealthK8s?: | { readonly namespace?: string | undefined; readonly labelSelector?: string | undefined } | undefined readonly shardingConfig?: Partial<ShardingConfig.ShardingConfig["Service"]> | undefined}) => ClientOnly extends true ? Layer.Layer< Sharding | Runners.Runners | ("byo" extends Storage ? never : MessageStorage.MessageStorage), Config.ConfigError, "local" extends Storage ? never : "byo" extends Storage ? MessageStorage.MessageStorage | RunnerStorage.RunnerStorage : SqlClient > : Layer.Layer< Sharding | Runners.Runners | ("byo" extends Storage ? never : MessageStorage.MessageStorage), ServeError | Config.ConfigError, "local" extends Storage ? never : "byo" extends Storage ? MessageStorage.MessageStorage | RunnerStorage.RunnerStorage : SqlClient >Since v4.0.0
layerHttpServer
Section titled “layerHttpServer”Provides the HTTP server and Node HTTP services used by cluster runners,
listening on ShardingConfig.runnerListenAddress or runnerAddress.
Signature
declare const layerHttpServer: Layer.Layer< NodeServices | HttpServer | HttpPlatform | Etag.Generator, ServeError, ShardingConfig.ShardingConfig>Since v4.0.0
re-exports
Section titled “re-exports”layerK8sHttpClient
Section titled “layerK8sHttpClient”Provides the Kubernetes HTTP client layer used by Kubernetes runner health checks.
Signature
declare const layerK8sHttpClient: Layer.Layer<K8sHttpClient, never, never>Since v4.0.0