<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 fortag, 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" })function function unix<Self, S extends Spec>(tag: HyperlinkTag<Self, S>, options?: DiscoverClientOptions): Layer.Layer<Self, LookupClientError> (+1 overload)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" })
unix<function (type parameter) Self in unix<Self, S extends Spec>(tag: HyperlinkTag<Self, S>, options?: DiscoverClientOptions): Layer.Layer<Self, LookupClientError>Self, function (type parameter) S in unix<Self, S extends Spec>(tag: HyperlinkTag<Self, S>, options?: DiscoverClientOptions): Layer.Layer<Self, LookupClientError>S extends Spec>(
tag: HyperlinkTag<Self, S>(parameter) tag: {
description: string | undefined;
key: Identifier;
of: (this: void, self: Simplify<{ readonly [K in keyof S]: S[K] extends FromLocalMethod<infer M> ? InjectLocal<M, Self> : S[K] extends LocalMethod<infer T> ? LocalEffect<T, never, Self> : S[K] extends DefaultMethod<infer F> ? F : S[K] extends …;
context: (self: Simplify<{ readonly [K in keyof S]: S[K] extends FromLocalMethod<infer M> ? InjectLocal<M, Self> : S[K] extends LocalMethod<infer T> ? LocalEffect<T, never, Self> : S[K] extends DefaultMethod<infer F> ? F : S[K] extends { readonly _…;
use: (f: (service: Simplify<{ readonly [K in keyof S]: S[K] extends FromLocalMethod<infer M> ? InjectLocal<M, Self> : S[K] extends LocalMethod<infer T> ? LocalEffect<T, never, Self> : S[K] extends DefaultMethod<infer F> ? F : S[K] extends { rea…;
useSync: (f: (service: Simplify<{ readonly [K in keyof S]: S[K] extends FromLocalMethod<infer M> ? InjectLocal<M, Self> : S[K] extends LocalMethod<infer T> ? LocalEffect<T, never, Self> : S[K] extends DefaultMethod<infer F> ? F : S[K] extends { rea…;
Identifier: Identifier;
Service: Shape;
stack: string | undefined;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
toString: () => string;
toJSON: () => unknown;
}
tag: interface HyperlinkTag<Self, S extends Spec, Svc = Simplify<{ readonly [K in keyof S]: S[K] extends FromLocalMethod<infer M> ? InjectLocal<M, Self> : S[K] extends LocalMethod<infer T> ? LocalEffect<...> : S[K] extends DefaultMethod<...> ? F : S[K] extends { ...; } ? SuccessOf<...> : S[K] extends { ...; } ? Subscribable<...> : S[K] extends { ...; } ? ClientMethod<...> : S[K] extends Spec ? Simplify<...> : never; }>>The type of a HyperService tag carrying spec S — what
Hyperlink.Tag
produces
(and what you extend). Lets a consumer write
<S extends Spec>(tag: HyperlinkTag<Self, S>) and read the spec through named types
(
specOf
/
groupOf
) instead of a Parameters<typeof specOf> workaround.
HyperlinkTag<function (type parameter) Self in unix<Self, S extends Spec>(tag: HyperlinkTag<Self, S>, options?: DiscoverClientOptions): Layer.Layer<Self, LookupClientError>Self, function (type parameter) S in unix<Self, S extends Spec>(tag: HyperlinkTag<Self, S>, options?: DiscoverClientOptions): Layer.Layer<Self, LookupClientError>S>,
options: DiscoverClientOptionsoptions?: type DiscoverClientOptions =
LookupClientOptions & {
readonly lookupPath?: string
readonly unlink?: boolean
}
Options for
unix
(tag) /
discoverClients
— Lookup soft-pick plus
default-lookup bootstrap knobs (lookupPath, unlink).
DiscoverClientOptions,
): import LayerLayer.interface Layer<in ROut, out E = never, out RIn = never>A Layer describes how to build one or more services for dependency injection.
When to use
Use to model construction of application services for dependency injection,
especially when services have dependencies, can fail during construction, or
need scoped setup and release.
Details
A Layer<ROut, E, RIn> represents ROut as the services this layer
provides, E as the possible errors during layer construction, and RIn as
the services this layer requires as dependencies.
Layer<function (type parameter) Self in unix<Self, S extends Spec>(tag: HyperlinkTag<Self, S>, options?: DiscoverClientOptions): Layer.Layer<Self, LookupClientError>Self, class LookupClientErrorclass LookupClientError {
name: string;
message: string;
stack: string;
cause: unknown;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
toString: () => string;
toJSON: () => unknown;
_tag: Tag;
tag: string;
reason: 'missing' | 'ambiguous';
count: number;
}
lookupClient
could not resolve exactly one dial target for the Tag
(missing = none; ambiguous = more than one directory row and no
LookupClientOptions.pick
).
LookupClientError>;
function 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> (+1 overload)
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" })
unix<function (type parameter) Self in 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>
Self>(
node: NodeKey<Self> & {
readonly path?: string
readonly endpoints?: Endpoints
}
node: type NodeKey<HSelf> = Context.Key<HSelf, NodeProtocol>The Context key of a
Node
(HSelf = its identity): a service whose value is the
transport
NodeProtocol
. Stored on a node-bearing tag under
nodeSym
; read by
Hyperlink.client
to resolve where to connect (its requirement channel).
NodeKey<function (type parameter) Self in 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>
Self> & { readonly path?: string | undefinedpath?: string; readonly endpoints?: Endpoints | undefinedendpoints?: Endpoints },
options: {
readonly path?: string
readonly serialization?: Layer.Layer<RpcSerialization.RpcSerialization>
}
options?: {
readonly path?: string | undefinedpath?: string;
readonly serialization?: Layer.Layer<RpcSerialization.RpcSerialization>serialization?: import LayerLayer.interface Layer<in ROut, out E = never, out RIn = never>A Layer describes how to build one or more services for dependency injection.
When to use
Use to model construction of application services for dependency injection,
especially when services have dependencies, can fail during construction, or
need scoped setup and release.
Details
A Layer<ROut, E, RIn> represents ROut as the services this layer
provides, E as the possible errors during layer construction, and RIn as
the services this layer requires as dependencies.
Layer<import RpcSerializationRpcSerialization.class RpcSerializationclass RpcSerialization {
key: Identifier;
Service: {
makeUnsafe: () => RpcSerialization.Parser;
contentType: string;
includesFraming: boolean;
};
}
Service that describes how RPC protocol messages are encoded and decoded,
including the content type and whether the serialization format provides
message framing.
When to use
Use to provide the serialization boundary shared by RPC clients and servers
for a chosen wire format.
RpcSerialization>;
},
): import LayerLayer.interface Layer<in ROut, out E = never, out RIn = never>A Layer describes how to build one or more services for dependency injection.
When to use
Use to model construction of application services for dependency injection,
especially when services have dependencies, can fail during construction, or
need scoped setup and release.
Details
A Layer<ROut, E, RIn> represents ROut as the services this layer
provides, E as the possible errors during layer construction, and RIn as
the services this layer requires as dependencies.
Layer<function (type parameter) Self in 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>
Self, class UnaddressedNodeclass UnaddressedNode {
message: string;
name: string;
stack: string;
cause: unknown;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
toString: () => string;
toJSON: () => unknown;
_tag: Tag;
node: string;
}
Deriving a transport from a node that never declared one — a bare Node.Tag()("x") has no
address/kind, so connect / listen can't know how to reach it. Surfaces on the Layer / Effect
error channel (never a sync throw).
UnaddressedNode>;
function function unix<Self, S extends Spec>(tag: HyperlinkTag<Self, S>, options?: DiscoverClientOptions): Layer.Layer<Self, LookupClientError> (+1 overload)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" })
unix(
tagOrNode: unknowntagOrNode: unknown,
options: DiscoverClientOptions & {
readonly path?: string
readonly serialization?: Layer.Layer<RpcSerialization.RpcSerialization>
}
options?: type DiscoverClientOptions =
LookupClientOptions & {
readonly lookupPath?: string
readonly unlink?: boolean
}
Options for
unix
(tag) /
discoverClients
— Lookup soft-pick plus
default-lookup bootstrap knobs (lookupPath, unlink).
DiscoverClientOptions & {
readonly path?: string | undefinedpath?: string;
readonly serialization?: Layer.Layer<RpcSerialization.RpcSerialization>serialization?: import LayerLayer.interface Layer<in ROut, out E = never, out RIn = never>A Layer describes how to build one or more services for dependency injection.
When to use
Use to model construction of application services for dependency injection,
especially when services have dependencies, can fail during construction, or
need scoped setup and release.
Details
A Layer<ROut, E, RIn> represents ROut as the services this layer
provides, E as the possible errors during layer construction, and RIn as
the services this layer requires as dependencies.
Layer<import RpcSerializationRpcSerialization.class RpcSerializationclass RpcSerialization {
key: Identifier;
Service: {
makeUnsafe: () => RpcSerialization.Parser;
contentType: string;
includesFraming: boolean;
};
}
Service that describes how RPC protocol messages are encoded and decoded,
including the content type and whether the serialization format provides
message framing.
When to use
Use to provide the serialization boundary shared by RPC clients and servers
for a chosen wire format.
RpcSerialization>;
},
): import LayerLayer.interface Layer<in ROut, out E = never, out RIn = never>A Layer describes how to build one or more services for dependency injection.
When to use
Use to model construction of application services for dependency injection,
especially when services have dependencies, can fail during construction, or
need scoped setup and release.
Details
A Layer<ROut, E, RIn> represents ROut as the services this layer
provides, E as the possible errors during layer construction, and RIn as
the services this layer requires as dependencies.
Layer<unknown, class LookupClientErrorclass LookupClientError {
name: string;
message: string;
stack: string;
cause: unknown;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
toString: () => string;
toJSON: () => unknown;
_tag: Tag;
tag: string;
reason: 'missing' | 'ambiguous';
count: number;
}
lookupClient
could not resolve exactly one dial target for the Tag
(missing = none; ambiguous = more than one directory row and no
LookupClientOptions.pick
).
LookupClientError | class UnaddressedNodeclass UnaddressedNode {
message: string;
name: string;
stack: string;
cause: unknown;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
toString: () => string;
toJSON: () => unknown;
_tag: Tag;
node: string;
}
Deriving a transport from a node that never declared one — a bare Node.Tag()("x") has no
address/kind, so connect / listen can't know how to reach it. Surfaces on the Layer / Effect
error channel (never a sync throw).
UnaddressedNode> {
if (const isUnixDiscoverTag: (
u: unknown
) => u is HyperlinkTag<any, any>
True when u is a Hyperlink resource Tag (specSym), not a
Node
.
isUnixDiscoverTag(tagOrNode: unknowntagOrNode)) {
return const unixDiscoverDial: <
Self,
S extends Spec
>(
tag: HyperlinkTag<Self, S>,
options?: DiscoverClientOptions
) => Layer.Layer<Self, LookupClientError>
Lookup bootstrap +
lookupClient
for one tag — body of
unix
(tag).
unixDiscoverDial(tagOrNode: HyperlinkTag<
any,
any,
{
readonly [x: string]: unknown
}
>
(parameter) tagOrNode: {
description: string | undefined;
key: Identifier;
of: (this: void, self: { readonly [x: string]: unknown }) => { readonly [x: string]: unknown };
context: (self: { readonly [x: string]: unknown }) => Context.Context<any>;
use: (f: (service: { readonly [x: string]: unknown }) => Effect.Effect<A, E, R>) => Effect.Effect<A, E, any>;
useSync: (f: (service: { readonly [x: string]: unknown }) => A) => Effect.Effect<A, never, any>;
Identifier: Identifier;
Service: Shape;
stack: string | undefined;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
toString: () => string;
toJSON: () => unknown;
}
tagOrNode, options: DiscoverClientOptions & {
readonly path?: string
readonly serialization?: Layer.Layer<RpcSerialization.RpcSerialization>
}
options);
}
return const unixNodeDial: <Self>(
node: NodeKey<Self> & {
readonly path?: string
readonly endpoints?: Endpoints
},
options?: {
readonly path?: string
readonly serialization?: Layer.Layer<RpcSerialization.RpcSerialization>
}
) => Layer.Layer<Self, UnaddressedNode>
Per-node ipc dial —
connect
+
protocolIpc
. Shared by
unix
(node) and
nPipe
. Tag / Lookup discovery is the other
unix
overload (defined with
DiscoverClientOptions
below).
unixNodeDial(
tagOrNode: unknowntagOrNode as type NodeKey<HSelf> = Context.Key<HSelf, NodeProtocol>The Context key of a
Node
(HSelf = its identity): a service whose value is the
transport
NodeProtocol
. Stored on a node-bearing tag under
nodeSym
; read by
Hyperlink.client
to resolve where to connect (its requirement channel).
NodeKey<unknown> & {
readonly path?: string | undefinedpath?: string;
readonly endpoints?: Endpoints | undefinedendpoints?: Endpoints;
},
options: DiscoverClientOptions & {
readonly path?: string
readonly serialization?: Layer.Layer<RpcSerialization.RpcSerialization>
}
options,
);
}