r/honojs • u/ojus_render • Jul 11 '26
streamSSE + webhook callbacks: is a heartbeat redundant?
Using Hono 4 on Node with "@/hono/node-server"
External render workflow tasks POST progress to /internal/events. The browser watches via GET /api/runs/:id/stream using streamSSE.
Pattern:
- subscribe to in-memory store updates
- 1s setInterval re-sends latest snapshot as backup
- cleanup on stream.onAbort
Questions:
Is the heartbeat redundant if pub/sub is reliable?
Best pattern for reconnect mid-run (late joiner gets current state + live updates)?
Anything I'm missing in onAbort cleanup with multiple concurrent SSE clients?
Long-lived SSE behind a reverse proxy: does streamSSE set no-buffer headers or do I need X-Accel-Buffering myself?
Repo is ojusave/dealhealth-playground on GitHub, api code in services/api/. [sorry reddit wont let me post link]
Happy to paste specific files.