Skip to content
1 min read · 124 words

Interface: IsolationTransport

Defined in: src/batteries/isolation/types.ts:335

The environment-specific spawn/lifecycle duck a host-side transport implements — WP2 (Web Worker) and WP3 (node child_process) each provide one; createIsolatedService (host.ts) drives only this interface, never a concrete Worker/ChildProcess type.

Methods

connect()

ts
connect(): Promise<PortLike>;

Defined in: src/batteries/isolation/types.ts:337

Spawn (or reuse) the guest and resolve once a PortLike is ready to exchange envelopes.

Returns

Promise<PortLike>


onCrash()

ts
onCrash(fn: (info: CrashInfo) => void): () => void;

Defined in: src/batteries/isolation/types.ts:341

Subscribe to crash notifications (unexpected exit/termination). Returns an unsubscribe function.

Parameters

ParameterType
fn(info: CrashInfo) => void

Returns

() => void


terminate()

ts
terminate(): void | Promise<void>;

Defined in: src/batteries/isolation/types.ts:339

Tear down the guest unconditionally (kill/terminate). May be sync or async.

Returns

void | Promise<void>