*** title: Updates description: >- Stream real-time events from your organization — runtime changes, operation completions, and more. ---------------------- The updates client provides a real-time event stream for your organization. Use it to react to runtime state changes, operation completions, and other events without polling. Access via `bctrl.updates`. ## stream(signal?) Subscribe to a real-time event stream. Returns an async generator that yields events as they occur. ```ts const controller = new AbortController(); for await (const event of bctrl.updates.stream(controller.signal)) { console.log(event.type, event.data); if (event.type === "runtime.stopped") { break; } } ``` | Parameter | Type | Required | Description | | --------- | ------------- | -------- | --------------------------------- | | `signal` | `AbortSignal` | No | Abort signal to cancel the stream | **Returns** `AsyncGenerator` — yields events until the stream ends or is aborted. The stream uses Server-Sent Events (SSE) under the hood, with automatic reconnection. *** ## Example: waiting for a runtime to stop ```ts async function waitForStop(runtimeAlias: string) { const controller = new AbortController(); for await (const event of bctrl.updates.stream(controller.signal)) { if ( event.type === "runtime.stopped" && event.data.alias === runtimeAlias ) { controller.abort(); return event.data; } } } ```