Interface: IsolatedService<S>
Defined in: src/batteries/isolation/host.ts:69
The host-side handle createIsolatedService returns.
Type Parameters
| Type Parameter |
|---|
S extends IsolatedServiceSpec |
Properties
| Property | Modifier | Type | Description | Defined in |
|---|---|---|---|---|
api | readonly | IsolatedFacade<S> | The callable facade — one function per declared method/stream. | src/batteries/isolation/host.ts:71 |
state | readonly | IsolatedServiceState | Current lifecycle state. | src/batteries/isolation/host.ts:78 |
Methods
dispose()
dispose(): Promise<void>;Defined in: src/batteries/isolation/host.ts:81
Send shutdown, wait up to disposeGraceMs for the guest to exit on its own, then force transport.terminate() regardless. Idempotent past the first call.
Returns
Promise<void>
on()
on<K>(channel: K, fn: IsolatedEventListener<S, K>): () => void;Defined in: src/batteries/isolation/host.ts:74
Subscribe to a declared event channel. Returns an unsubscribe function. Subscriptions survive recycle() (the same underlying map is reused across guest respawns).
Type Parameters
| Type Parameter |
|---|
K extends string |
Parameters
| Parameter | Type |
|---|---|
channel | K |
fn | IsolatedEventListener<S, K> |
Returns
() => void
onCrash()
onCrash(fn: (info: CrashInfo) => void): () => void;Defined in: src/batteries/isolation/host.ts:76
Subscribe to crash notifications. Returns an unsubscribe function.
Parameters
| Parameter | Type |
|---|---|
fn | (info: CrashInfo) => void |
Returns
() => void
recycle()
recycle(): Promise<void>;Defined in: src/batteries/isolation/host.ts:84
Terminate the current guest and reconnect through the same transport.connect(). Object identity and .on(...) subscriptions survive; in-flight calls/streams reject with E_ISOLATED_TERMINATED.
Returns
Promise<void>