Dial the same-machine Lookup path (defaultIpcPath or options.path).
Effect precedent: options factory beside a default Layer value (layerAgentOptions).
export const const clientOptions: (options?: {
readonly path?: string
}) => Layer.Layer<Services, LookupUnaddressed>
Dial the same-machine Lookup path (
defaultIpcPath
or options.path).
Effect precedent: options factory beside a default Layer value (layerAgentOptions).
clientOptions = (options: | {
readonly path?: string
}
| undefined
options?: {
readonly path?: string | undefinedpath?: string;
}): 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<type Services =
| Identity
| Directory
| Advice
Services a Lookup client layer provides — identity, directory, and placement advice.
Services, class LookupUnaddressedclass LookupUnaddressed {
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;
node: string;
}
Lookup node has no dialable address — need { path } / url, or use
layer
/
layerOptions
. Layer error channel (not a sync throw).
LookupUnaddressed> => {
const const path: stringpath = options: | {
readonly path?: string
}
| undefined
options?.path?: string | undefinedpath ?? const defaultIpcPath: "/tmp/hyperlink-ts-lookup.sock"Well-known Unix socket path for same-machine default lookup (L1).
Prefer overriding in tests so suites don't collide on one machine.
defaultIpcPath;
const const node: anynode = import NodeTagNodeTag()("hyperlink-ts/Lookup/default", { path: stringpath }).pipe(import asLookupasLookup);
return const client: (
node: AnyNode & { readonly path?: string }
) => Layer.Layer<Services, LookupUnaddressed>
Client for
Identity
+
Directory
via an ipc
LookupNode
.
client(const node: anynode);
};