(
node: AnyNode & { readonly key: string },
options?: { readonly unlink?: boolean }
): Layer.Layer<never, LookupUnaddressed>Serve Lookup exclusively on an addressed Node.Lookup (ipc { path } in v1).
Reads concrete OnConflict from the Lookup node stamp.
Same-machine bind-or-dial without a Node: layer / layerOptions.
export const const layerNode: (
node: AnyNode & { readonly key: string },
options?: { readonly unlink?: boolean }
) => Layer.Layer<never, LookupUnaddressed>
Serve Lookup exclusively on an addressed
Node.Lookup
(ipc { path } in v1).
Reads concrete
OnConflict
from the Lookup node stamp.
Same-machine bind-or-dial without a Node:
layer
/
layerOptions
.
layerNode = (
node: anynode: import AnyNodeAnyNode & { readonly key: stringkey: string },
options: | {
readonly unlink?: boolean
}
| undefined
options?: { readonly unlink?: boolean | undefinedunlink?: boolean },
): 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<never, 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> => {
if (node: anynode.kind === "IpcSocket" && node: anynode.path !== var undefinedundefined) {
const const stamped: anystamped = import onConflictOfonConflictOf(node: anynode);
const const onConflict: anyonConflict = import resolveOnConflictresolveOnConflict(const stamped: anystamped);
return const layerIpc: (
path: string,
options?: {
readonly unlink?: boolean
readonly onConflict?: OnConflictResolved
}
) => any
Serve
Identity
+
Directory
+
Advice
on a Unix-domain path.
layerIpc(node: anynode.path, {
...options: | {
readonly unlink?: boolean
}
| undefined
options,
onConflict?: anyFleet-parent conflict policy (concrete). Default livenessReplace.
onConflict,
});
}
return const lookupUnaddressedLayer: <A = never>(
node: string
) => Layer.Layer<A, LookupUnaddressed>
Fail a Layer build with
LookupUnaddressed
.
lookupUnaddressedLayer(node: anynode.key);
};