Playground · SSE
Server-sent events, live.
This is a working preview of the kind of real-time event stream that powers InstaEscrow. Phase 2 connects the widget below to a real Phoenix backend at live.erick.africa . Open DevTools → Network and you'll see actual EventSource frames, automatic reconnect, and replay via Last-Event-ID. Phase 1 simulates events client-side so the page is fast and offline-safe.
- 15:1115:11:25instaescroworder.createdBuyer placed order #IE-4486, KES 850
- 15:1115:11:25autopaypayment.authorizedM-Pesa STK push confirmed, KES 1,250
- 15:1115:11:25instaescrowescrow.heldFunds held in escrow #ESC-5104
- 15:1115:11:25logisticsdelivery.dispatchedOrder #IE-0941 dispatched to courier
- 15:1115:11:25instaescrowdelivery.confirmedBuyer confirmed receipt, auto-release in 24h
- 15:1115:11:25autopaypayment.releasedReleased KES 18,000 to seller wallet
- 15:1115:11:25autopaywallet.payoutSeller withdrew KES 32,500 via Paystack transfer
- 15:1115:11:25arbiterdispute.openedDispute #DSP-7195 opened, buyer claims item not received
- 15:1115:11:25arbiterdispute.resolvedDispute #DSP-9027 resolved in buyer's favor
- 15:1115:11:25iamkyc.verifiedVendor KYC document verified, unlocked withdrawals
- 15:1115:11:25beaconsession.connectedSSE client #4486 connected, XREAD BLOCK active
- 15:1115:11:25beaconsession.replayedReplayed 12 events from last-event-id for reconnecting client
Architecture
Redis Streams + per-user XREAD BLOCK
Each connected client is a Phoenix process that holds an XREAD BLOCK against its personal stream. Server fan-out is XADD to the right key. Persistence and replay come for free.
Reconnect semantics
Last-Event-ID replay
Reconnecting clients send the last event ID they saw; the server replays everything missed during the gap, then resumes live. Mobile apps roaming networks never miss an event.
Presence
TTL-based heartbeats
Every client refreshes its presence key in Redis with a 30s TTL. Disconnects expire naturally without server-side cleanup hooks.
Capacity
Per-user connection caps
One device, two browser tabs, three Flutter app instances: limits per user prevent connection exhaustion from runaway clients.