Real-Time Updates

Server-Sent Events Architecture
Lion Reader uses Server-Sent Events (SSE) powered by Redis pub/sub to deliver real-time updates without polling. When a feed worker fetches new content, it publishes events to Redis channels. Your browser maintains an open SSE connection that listens to these channels, receiving updates the moment they happen. This architecture is both efficient and scalable — your connection only subscribes to events for feeds you actually care about.
Channel Types
- Per-feed channels — Each feed has its own channel (
feed:{feedId}:events). When you subscribe to a feed, your SSE connection automatically subscribes to that feed’s channel. This means you only receive events for feeds you follow, reducing noise and bandwidth. - Per-user channels — Account-level events like subscription changes and OPML import progress use a dedicated user channel (
user:{userId}:events). This ensures actions taken in other browser sessions appear instantly across all your devices.
Event Types
Lion Reader sends several types of real-time events:
- new_entry — A new article was published to a feed you subscribe to
- entry_updated — An article’s content was updated by the publisher
- subscription_created — You added a new subscription from another device or session
- import_progress — Real-time status updates during OPML import
Updates that stay out of your way
When an event arrives, new content shows up in your lists automatically — no page refresh, no clicking to reload. The key detail is how: instead of re-fetching and redrawing the whole list, Lion Reader updates just the data that changed. A new article is inserted at its correct spot by date, and read or starred changes are applied in place. So if you’re partway down a list reading, your scroll position and the article in front of you stay put — updates never yank the page around underneath you. Your own actions (starring, marking read) apply instantly and reconcile automatically if two devices disagree.
Reliability and Fallbacks
The SSE connection includes a heartbeat keepalive every 30 seconds to detect and recover from network issues. If Redis becomes unavailable, Lion Reader gracefully degrades to a timestamp-based sync endpoint that provides eventual consistency without real-time updates. When you subscribe to a new feed, your SSE connection dynamically starts listening to that feed’s channel without reconnecting, ensuring you never miss new content.