Skip to main content

Module live

Module live 

Source
Expand description

Live pages (M3.3, decisions 34A and 23A): what changed in each deployment, relayed to the browsers, and a running attempt’s log as it grows.

  • Relays: one per deployment, started by the first browser that wants its changes: it reads the webserver’s GET /api/v1/changes and hands each change to every browser following that deployment; when the stream ends or can’t be opened it tries again (after 1 s, doubling to 30 s), and once it is back sends refresh, since anything may have changed meanwhile.
  • GET /events: a browser’s one stream (decision 175: its pages share it through a SharedWorker, assets/live.js): every deployment’s changes, each page deciding which concern it and reading its live parts again (hx-trigger="live:change").
  • The log tail: GET /d/<deployment>/runs/<run>/tasks/<task>/tail?try=&from= answers the log’s next part (HTML, colours converted) and the element reading the one after it, polled about once a second while the attempt runs (no connection held).

Structs§

Follow
GET /events’s query.
Relays
The relays, one per deployment (in the order of Ui::deployments), each started by its first subscriber.
TailQuery
The log tail’s query: which try, where its log continues, and how it was shown.
UiTimings
How the live pages are paced.

Enums§

Change
A change in a deployment, as its webserver announced it.

Constants§

COALESCE
A page’s stream sends at most one change this often (per deployment).
KEEP_ALIVE
How often a page’s stream gets a ping (and the log tail a comment).
SLOW_READ
A Runs page read longer than this is slow: the page then reads again at most every SLOW_READ_WAIT (a name filter matching DAGs with long histories: 114 ms over 500,000 runs, against 0.3 ms unfiltered; the user, 2026-11-16).
SLOW_READ_WAIT
How often a page whose last read was slow reads again at most.
TAIL_GIVE_UP
How long the log tail keeps trying a log out of reach before it says so and stops.
TAIL_INTERVAL
How often the log tail reads the log.

Functions§

events
GET /events: one browser’s stream of every deployment’s changes (decision 175: its tabs share it, and each page decides which concern it). First a hello (now, in milliseconds since the epoch), then a change event for each change (JSON: deployment, kind run/dag/workers/refresh, run, dag, at), the same change at most once a COALESCE per deployment (never dropped: sent when that time is up), and a ping every KEEP_ALIVE (a page polls when even those stop coming: a proxy buffering the stream).
tail
GET /d/<deployment>/runs/<run>/tasks/<task>/tail?try=&from= (decision 175: polled, so it holds no connection): the log from from as HTML, the colours carried from the part before (style), followed by the element reading the next part (in TAIL_INTERVAL, at once when more is waiting), which replaces itself with the answer. Nothing follows once the attempt has ended and all of it is shown, or once the log can’t be read (said where it is shown): gone, or out of reach for TAIL_GIVE_UP.
tail_reader
The element reading a log’s next part from url (with the prefix): in TAIL_INTERVAL, or at once; again a second after the UI didn’t answer (retry, sent by the page).