---
url: 'https://adk.nht.io/api/@nhtio/adk/batteries/interfaces/IsolatedService.md'
description: The host-side handle `createIsolatedService` returns.
---

# Interface: IsolatedService\<S>

Defined in: [src/batteries/isolation/host.ts:63](https://github.com/NHTIO/ADK/blob/v1.20260713.1/src/src/batteries/isolation/host.ts#L63)

The host-side handle `createIsolatedService` returns.

## Type Parameters

| Type Parameter                                                |
| ------------------------------------------------------------- |
| `S` *extends* [`IsolatedServiceSpec`](IsolatedServiceSpec.md) |

## Properties

| Property                            | Modifier   | Type                                                              | Description                                                    | Defined in                                                                                                                    |
| ----------------------------------- | ---------- | ----------------------------------------------------------------- | -------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- |
|  `api`     | `readonly` | [`IsolatedFacade`](../type-aliases/IsolatedFacade.md)<`S`>      | The callable facade — one function per declared method/stream. | [src/batteries/isolation/host.ts:65](https://github.com/NHTIO/ADK/blob/v1.20260713.1/src/src/batteries/isolation/host.ts#L65) |
|  `state` | `readonly` | [`IsolatedServiceState`](../type-aliases/IsolatedServiceState.md) | Current lifecycle state.                                       | [src/batteries/isolation/host.ts:72](https://github.com/NHTIO/ADK/blob/v1.20260713.1/src/src/batteries/isolation/host.ts#L72) |

## Methods

### dispose()

```ts
dispose(): Promise<void>;
```

Defined in: [src/batteries/isolation/host.ts:75](https://github.com/NHTIO/ADK/blob/v1.20260713.1/src/src/batteries/isolation/host.ts#L75)

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()

```ts
on<K>(channel: K, fn: IsolatedEventListener<S, K>): () => void;
```

Defined in: [src/batteries/isolation/host.ts:68](https://github.com/NHTIO/ADK/blob/v1.20260713.1/src/src/batteries/isolation/host.ts#L68)

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`](../type-aliases/IsolatedEventListener.md)<`S`, `K`> |

#### Returns

() => `void`

***

### onCrash()

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

Defined in: [src/batteries/isolation/host.ts:70](https://github.com/NHTIO/ADK/blob/v1.20260713.1/src/src/batteries/isolation/host.ts#L70)

Subscribe to crash notifications. Returns an unsubscribe function.

#### Parameters

| Parameter | Type                                            |
| --------- | ----------------------------------------------- |
| `fn`      | (`info`: [`CrashInfo`](CrashInfo.md)) => `void` |

#### Returns

() => `void`

***

### recycle()

```ts
recycle(): Promise<void>;
```

Defined in: [src/batteries/isolation/host.ts:78](https://github.com/NHTIO/ADK/blob/v1.20260713.1/src/src/batteries/isolation/host.ts#L78)

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`>
