Function: serveIsolatedOverPort()
ts
function serveIsolatedOverPort<S>(
spec: S,
factory: IsolatedImplementationFactory<S>,
port: PortLike,
options?: ServeIsolatedOptions,
): {
stop: () => void;
};Defined in: src/batteries/isolation/serve.ts:90
Serve spec over an already-constructed PortLike — the environment-neutral primitive. Builds the implementation via factory, wires a GuestEndpoint to it, and announces readiness (ready envelope) once the encoder-availability probe resolves.
Type Parameters
| Type Parameter |
|---|
S extends IsolatedServiceSpec<MethodMap, StreamMap, EventMap> |
Parameters
| Parameter | Type |
|---|---|
spec | S |
factory | IsolatedImplementationFactory<S> |
port | PortLike |
options? | ServeIsolatedOptions |
Returns
ts
{
stop: () => void;
}A stop() function that tears down the endpoint's port subscription. Does NOT itself close the port — callers own the port's lifecycle.
| Name | Type | Defined in |
|---|---|---|
stop() | () => void | src/batteries/isolation/serve.ts:95 |
Throws
@nhtio/adk/batteries/isolation!E_INVALID_ISOLATION_OPTIONS when options fails validation.