Hyperlinkv0.9.0-beta.0

Hyperlink

Hyperlink.unixfunctionsrc/Hyperlink.ts:5720
<Self, S extends Spec>(
  tag: HyperlinkTag<Self, S>,
  options?: DiscoverClientOptions
): Layer.Layer<Self, LookupClientError>
<Self>(
  node: NodeKey<Self> & {
    readonly path?: string
    readonly endpoints?: Endpoints
  },
  options?: {
    readonly path?: string
    readonly serialization?: Layer.Layer<RpcSerialization.RpcSerialization>
  }
): Layer.Layer<Self, UnaddressedNode>

Same-machine ipc client — sibling of Node.unix.

  • unix(node) — dial that Node’s Unix-domain path (connect + protocolIpc).
  • unix(tag) — nameless / Lookup path: soft-bake Lookup, resolve an endpoint for tag, and dial it (identity, then directory). Pairs with nameless Node.unix([serve…]).
// Named node you already addressed:
Hyperlink.unix(Worker)

// Nameless serve advertised via Lookup:
Hyperlink.unix(Emails)
Hyperlink.unix(Jobs, { lookupPath, pick: "first" })
clientsNode.unixprotocolIpc
Source src/Hyperlink.ts:572029 lines
function unix<Self, S extends Spec>(
  tag: HyperlinkTag<Self, S>,
  options?: DiscoverClientOptions,
): Layer.Layer<Self, LookupClientError>;
function unix<Self>(
  node: NodeKey<Self> & { readonly path?: string; readonly endpoints?: Endpoints },
  options?: {
    readonly path?: string;
    readonly serialization?: Layer.Layer<RpcSerialization.RpcSerialization>;
  },
): Layer.Layer<Self, UnaddressedNode>;
function unix(
  tagOrNode: unknown,
  options?: DiscoverClientOptions & {
    readonly path?: string;
    readonly serialization?: Layer.Layer<RpcSerialization.RpcSerialization>;
  },
): Layer.Layer<unknown, LookupClientError | UnaddressedNode> {
  if (isUnixDiscoverTag(tagOrNode)) {
    return unixDiscoverDial(tagOrNode, options);
  }
  return unixNodeDial(
    tagOrNode as NodeKey<unknown> & {
      readonly path?: string;
      readonly endpoints?: Endpoints;
    },
    options,
  );
}