<!-- https://svgrid.com/docs/recipes/websocket-streaming/ - SvGrid documentation as markdown. Index of every page: https://svgrid.com/llms.txt -->

# WebSocket streaming with backpressure

> Live in [demo 34-realtime-orders](https://svgrid.com/demos/34-realtime-orders/).

> Live demo: Real-time / streaming - https://svgrid.com/demos/34-realtime-orders/

## When

Live tick stream with pause / resume / disconnect-and-replay and per-tick delta merge.

## How

Key API surface:

- `onmessage merges into $state`
- `pause flag throttles applies`

See the demo source for the full implementation; this recipe pins the
pattern + the surface so you can copy-paste it confidently. The doc
page that explains the underlying feature in depth is linked from the
[recipes index](https://github.com/sv-grid/sv-grid/blob/main/docs/recipes/index.md).

## See also

- [Demo 34-realtime-orders source](https://github.com/sv-grid/sv-grid/blob/main/examples/src/demos/34-realtime-orders.svelte)
- [Demo 34-realtime-orders prompt sidecar](https://github.com/sv-grid/sv-grid/blob/main/examples/src/demos/prompts/34-realtime-orders.md) - drop into an LLM context window
- [Recipes index](https://github.com/sv-grid/sv-grid/blob/main/docs/recipes/index.md)

---

SvGrid is the Svelte 5 data grid (`npm install @svgrid/grid`, MIT). This page: https://svgrid.com/docs/recipes/websocket-streaming/ . All docs: https://svgrid.com/llms.txt
