SSE Streaming Developer
Stream updates over plain HTTP: server-sent events versus WebSockets, chunked encoding, backpressure, and the proxies that truncate streams silently.
Path overview
单向推送场景下,SSE 以更低的复杂度换走 WebSocket 的大部分收益。本路径从技术选型与分块编码讲起,覆盖浏览器端订阅与背压、服务端流式响应,最终直面代理截断与流生命周期错误,收尾于 Next.js 流式 SSR 案例。
For one-way pushes, SSE buys most of WebSocket value at far lower complexity. This path covers selection criteria, chunked encoding, browser subscription with backpressure, proxy truncation, and a streaming SSR case.
Read "How to Choose Between SSE and WebSockets" for the "Transport and framing differences" argument, then name the decision in sse work it would change.
Next step: How to Implement Server-Sent Events in Node.js
⏱ 1h
Compare "The SSE wire format" with "Stream from the server" in "How to Implement Server-Sent Events in Node.js" and state which trade-off you would accept in sse code.
Prerequisites: How to Choose Between SSE and WebSockets
Next step: SSE Typed Event Stream Subscription
⏱ 1h
Execute "SSE Typed Event Stream Subscription", change one constant, and describe how the output diverges from "Subscribe to a typed server-sent event stream with EventSource listeners per event type,".
Prerequisites: How to Implement Server-Sent Events in Node.js
Next step: Fetch Streaming Response Backpressure
⏱ 0.75h
Run the sse snippet "Fetch Streaming Response Backpressure", capture stdout, and show which line demonstrates the documented behavior: "Read a fetch response body as a stream with manual reader control, honoring backpressure so".
Prerequisites: SSE Typed Event Stream Subscription
Next step: Axum Streaming Response Body
⏱ 0.75h
Adapt "Axum Streaming Response Body" to a second input and compare the new output with the behavior described in "Stream large responses from an async generator into the response body, applying timeouts per".
Prerequisites: Fetch Streaming Response Backpressure
Next step: Next.js App Router Streaming SSR
⏱ 0.75h
Compare "Next.js App Router Streaming SSR"'s Next.js, React, TypeScript, Vercel design with your sse stack and list the trade-off "React Suspense streaming with per-component loading states for progressive rendering" implies.
Next step: Encode Server-Sent Events Correctly
⏱ 1.5h
In the "SSE Streaming Developer" path, implement "Encode Server-Sent Events Correctly" so JSON object: { events: [{ id, event, data }] } yields id: 1\nevent: tick\ndata: ok\n\n, including the second sample's edge case.
Prerequisites: Next.js App Router Streaming SSR
Next step: Capstone: SSE Streaming Developer
⏱ 0.33h
Ship "Setup stream" from "Build a Server-Sent Events Broadcast Service", then prove it with the project's test suite and an acceptance note.
Prerequisites: Next.js App Router Streaming SSR, Encode Server-Sent Events Correctly
Next step: Run the capstone's tests, publish the repository, and demo it to a reviewer.
⏱ 4h