Menu

Post image 1
Post image 2
1 / 2
0

One SSE connection, N upstream agents — the stream relay we shipped

DEV Community·Takayuki Kawazoe·about 1 month ago
#yXyKNkhr
#sse#redis#fastapi#run_id#self#fullscreen
Reading 0:00
15s threshold

The pod that was tailing one of our long-running agents got rotated during a deploy. The client connection to the dashboard didn't disconnect — it sat there, EventSource happily believing the world was fine, with zero events coming through. The agent was still working. The events were still being emitted upstream. The middle box that was supposed to forward them to the browser was simply gone. That moment is the reason this post exists. If you're going to put a relay between N independent event-emitting backends and one client-facing SSE connection, you have to answer a specific question: when the relay process dies, what guarantees that another one picks up where it left off, and that the client doesn't notice? A lot of "just proxy SSE" designs fall apart at exactly this seam. I'm building a SaaS that touches this problem (Codens, an AI dev harness with a few specialized agents — happy to talk about it but it isn't the point of this post).…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.

Read More