Live updates
How it fits together

Live updates

Someone sends a message in a chat. The backend writes the message and, in the same transaction, tells the database to announce it.

Description

Each backend process keeps one dedicated connection to the database that does nothing but listen. It hears chat messages and chat events, along with a user's notifications. It also hears a job being queued or finished. Every open live stream to a browser subscribes to that listener. An announcement is passed to the streams whose filter matches, and the browser receives it. A heartbeat every 15 seconds keeps proxies from closing a quiet stream.