Catalog: say when a watched row changes, as it is
Jonas Templestein, 2026-11-27 00:01 UTC · b5bee93eb56138212ac7d62b429120b81ed7af56 · parent 6f4fd09
2 files changed
M core/itx/src/context/awake.ts
@@ -13,10 +13,13 @@ // - One Durable Object accepts 32,768 sockets. A dial refused past that is logged, and that // context is missing from the list: nothing else depends on the socket. // -// The same socket carries what a context says about itself (context-summary.ts), at most once per -// 15 s while it works and once before it closes. The accepting context keeps the newest of each in -// one SQLite row (context-catalog.ts): one row written per wake of a context, beside the rows that -// wake writes in its own log. +// The same socket carries what a context says about itself (context-summary.ts). While it works: +// when its activity stack changed or it said what it is, at most once per +// `AWAKE_ACTIVITY_DEBOUNCE_MS`; with no such change, once per `AWAKE_SUMMARY_EVERY_MS`. And once +// before it closes. A summary equal to the last one sent is not sent. The accepting context keeps +// the newest of each in one SQLite row (context-catalog.ts), written when the summary differs +// from the row: at least one row written per wake of a context, and for a context whose log +// grows fast up to ten a second, beside the rows that the wake writes in its own log. // // THE CATALOG ANSWERS EACH SUMMARY, on the same socket: it kept it, or it refused it. A context // that goes quiet keeps its socket until its last summary is answered, at most
M core/lib/src/api.ts
@@ -1873,8 +1873,11 @@ /** ONE CONTEXT AS A WATCH SENDS IT: its listing without `awake` and `activities` (the awake list * is a watch of its own, `{ awake: true }`), the two values that the orders sort by, and the - * catalog's revision at which the row last changed. A row changes when its context says - * something new of itself: at most once in 15 s while it works, and once when it goes quiet. */ + * catalog's revision at which the row last changed. A ROW CHANGES WHEN ITS CONTEXT'S SUMMARY + * DOES, in something that the row holds: the counts and times of its events, its storage, what + * it says of itself. A context that works sends a changed summary at most once in 100 ms, and + * its last one when it goes quiet. So the row of a context whose log grows fast changes up to + * ten times a second: a watcher that draws should not draw at each frame. */ export type CatalogRow = Omit<ContextListing, "awake" | "activities"> & { /** What the order `active` sorts by, in milliseconds: when the context was last active * (`lastActivityAt`, or `lastEventAt` when it has had no activity of its own). */