Skip to content
1 min read · 100 words

Function: forkIsolated() ​

ts
function forkIsolated<S>(
  spec: S,
  options: ForkIsolatedOptions,
): IsolatedService<S>;

Defined in: src/batteries/isolation/child_process/transport.ts:379

Sugar over createChildProcessTransport + @nhtio/adk/batteries/isolation!createIsolatedService — the one-call entry point most callers want: fork a guest module (or BYO-spawn one) and get back a ready-to-use @nhtio/adk/batteries/isolation!IsolatedService.

Type Parameters ​

Type Parameter
S extends IsolatedServiceSpec<MethodMap, StreamMap, EventMap>

Parameters ​

ParameterType
specS
optionsForkIsolatedOptions

Returns ​

IsolatedService<S>

Throws ​

@nhtio/adk/batteries/isolation!E_ISOLATION_UNSUPPORTED_ENV when called outside node.

Throws ​

@nhtio/adk/batteries/isolation!E_INVALID_ISOLATION_OPTIONS when options fails the mutual-exclusivity check documented on ForkIsolatedOptions, or when createIsolatedService's own option validation fails.