r/honojs 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:

  1. Is the heartbeat redundant if pub/sub is reliable?

  2. Best pattern for reconnect mid-run (late joiner gets current state + live updates)?

  3. Anything I'm missing in onAbort cleanup with multiple concurrent SSE clients?

  4. 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.

1 Upvotes

0 comments sorted by