Book 6 · Lesson 6.5
Redis Pub/Sub to live dashboard
- Trace analyzer PUBLISH to browser EventSource
- Read openEventStream in api/client.ts
- Populate Activity stream while tab is open
Prerequisites: 6.2 · 4.8
When analyzer calls warm_redis, it PUBLISHes to team_radar:events. The dashboard subscribes via SSE:
const source = new EventSource("/api/events/stream");
source.addEventListener("team_event", (msg) => …);
Connect SSE — POST webhook while tab open
Lab
Keep radar open → POST webhook → watch Activity stream row appear with sentiment + risk badge.
Teach-back prompt
What happens to SSE events if you close the tab?
Radar SSE activity
Lab complete — nice work.