<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 shortcut — connect + protocolIpc (same-machine Unix socket).
const const 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>
Per-node ipc shortcut —
connect
+
protocolIpc
(same-machine Unix socket).
unix = <function (type parameter) Self in <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: anynode: import NodeKeyNodeKey<function (type parameter) Self in <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?: anyendpoints?: import EndpointsEndpoints },
options: | {
readonly path?: string
readonly serialization?: Layer.Layer<RpcSerialization.RpcSerialization>
}
| undefined
options?: {
readonly path?: string | undefinedpath?: string;
readonly serialization?: | Layer.Layer<
RpcSerialization.RpcSerialization,
never,
never
>
| undefined
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 <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, import UnaddressedNodeUnaddressedNode> => {
// The client sibling of {@link Node.unix} — dial a Unix-domain ipc path.
const const sock: anysock = options: | {
readonly path?: string
readonly serialization?: Layer.Layer<RpcSerialization.RpcSerialization>
}
| undefined
options?.path?: string | undefinedpath ?? node: anynode.endpoints?.IpcSocket?.path ?? node: anynode.path;
if (const sock: anysock === var undefinedundefined) {
return import unaddressedLayerunaddressedLayer(node: anynode.key);
}
return import connectLayerconnectLayer(node: anynode, const protocolIpc: (
path: string,
serialization?: Layer.Layer<RpcSerialization.RpcSerialization>
) => Layer.Layer<RpcClient.Protocol>
Build an ipc client Protocol — Effect socket RPC over a Unix-domain path
(NodeSocket.layerNet({ path })). Same-machine counterpart to
protocolHttp
/
protocolWebsocket
.
protocolIpc(const sock: anysock, options: | {
readonly path?: string
readonly serialization?: Layer.Layer<RpcSerialization.RpcSerialization>
}
| undefined
options?.serialization?: | Layer.Layer<
RpcSerialization.RpcSerialization,
never,
never
>
| undefined
serialization));
};