Resumable streaming implementation The hard part of resumable streaming is done by the same-named package Some additional work was required since we don't return raw `Response` objects in TRPC That means we can't use AI SDK functions like `toUIMessageStreamResponse()` and the default chat transport protocol The resumable streaming happens in two places: - when we start a new stream on user message, we tee the UI stream: one side emits directly to the client, the other publishes to Redis as SSE - when the client resumes a running stream, it subscribes to the Redis stream and parses SSE back to UI chunks
New example for @trpcio + @aisdk: - TRPC streaming from an AI SDK UI message stream - resuming an ongoing stream after reload/disconnect - `useChat` with custom TRPC transport class The demo uses the `resumable-stream` package with an in-memory redis server