Hyperlinkv0.8.0-beta.28

Node

Node.ipcServerfunctionsrc/internal/nodeIpcServer.ts:86
<Serve extends Layer.Layer<never, any, any>>(
  serve: Serve,
  options: IpcServerOptions
): Layer.Layer<
  Layer.Success<Serve>,
  Layer.Error<Serve>,
  Layer.Services<Serve>
>
<Serves extends ServerServeList>(
  serves: Serves,
  options: IpcServerOptions
): Layer.Layer<
  Layer.Success<Serves[number]>,
  Layer.Error<Serves[number]>,
  Layer.Services<Serves[number]>
>

A Unix-domain RPC server — same-machine sibling of httpServer / wsServer. Speaks Effect's raw socket RPC protocol (RpcServer.layerProtocolSocketServer) over a filesystem path — no HTTP, no WebSocket upgrade. Clients connect with connectIpc or a node whose ProtocolKind is "IpcSocket" (Tag()("x", { path })).

class Worker extends Tag<Worker>()("worker", { path: "/tmp/worker.sock" }) {}

const live = Hyperlink.ipcServer(
  [Hyperlink.serve(Jobs, jobsImpl)],
  { path: "/tmp/worker.sock" },
)
// or Node.unix(Worker, [Hyperlink.serve(Jobs, jobsImpl)])

Auto-mounts NodeStatus like the http/ws servers. There is no /health HTTP route (no HTTP listener) — probe readiness via NodeStatus over RPC.

servershttpServerwsServerconnectIpcProtocolKindNodeStatus
export function ipcServer<Serve extends Layer.Layer<never, any, any>>(
  serve: Serve,
  options: IpcServerOptions,
): Layer.Layer<
  Layer.Success<Serve>,
  Layer.Error<Serve>,
  Layer.Services<Serve>
>;
export function ipcServer<Serves extends ServerServeList>(
  serves: Serves,
  options: IpcServerOptions,
): Layer.Layer<
  Layer.Success<Serves[number]>,
  Layer.Error<Serves[number]>,
  Layer.Services<Serves[number]>
>;
export function ipcServer(
  serves: Layer.Layer<never, any, any> | ServerServeList | ReadonlyArray<Layer.Layer<never, any, any>>,
  options: IpcServerOptions,
): Layer.Layer<never, any, any> {
  const list = (
    Array.isArray(serves) ? serves : [serves]
  ) as unknown as ServerServeList;
  return ipcServerBase(options).pipe(
    Layer.provideMerge(mergeServeList(list)),
    // Fresh registry per server — Lookup + Worker in one process must not share.
    Layer.provide(Layer.fresh(Hyperlink.servedHyperlinksLayer)),
  ) as Layer.Layer<never, any, any>;
}
Referenced by 1 symbols