---
url: 'https://adk.nht.io/api/@nhtio/adk/batteries/functions/stream.md'
---

# Function: stream()

```ts
function stream<A, D>(opts?: StreamOptions): StreamDescriptor<A, D>;
```

Defined in: [src/batteries/isolation/types.ts:126](https://github.com/NHTIO/ADK/blob/v1.20260713.1/src/src/batteries/isolation/types.ts#L126)

Declare a fire-and-forward streaming method on an isolated service's spec — the host gets a
`(...args) => ReadableStream<D>` facade method (synchronous: the stream is returned immediately, fed
by deltas as they cross the wire); the guest implementation returns (or is called to produce) a
`ReadableStream<D>` or `AsyncIterable<D>`.

## Type Parameters

| Type Parameter            | Description                            |
| ------------------------- | -------------------------------------- |
| `A` *extends* `unknown`\[] | The stream's argument tuple.           |
| `D`                       | The type of each streamed delta/chunk. |

## Parameters

| Parameter | Type                                              | Description                                          |
| --------- | ------------------------------------------------- | ---------------------------------------------------- |
| `opts`    | [`StreamOptions`](../interfaces/StreamOptions.md) | See [StreamOptions](../interfaces/StreamOptions.md). |

## Returns

[`StreamDescriptor`](../interfaces/StreamDescriptor.md)<`A`, `D`>
