Skip to main content

Module live

Module live 

Source
Expand description

UI-6: live() — a component’s collection bound to Plexus streams: { rows, status }.

The snapshot method is called once (each data event’s row is its one object-valued field — summary, ticket — and an event with none, a page, carries no row; PERF-15: a rows { items } event is a page’s rows at once, each item read as its own event would be); the changes stream (opened first, with its own changes_params) is folded by the declaration’s on:

  • upsert:<field> inserts or replaces, by key, the item at event.<field> — only if it matches every key of the snapshot’s params that names a field of the item (parent, epic, status; summary and limit name none), so a filtered collection ignores what is not its own, and an item that stops matching is removed;
  • remove:<field> removes the id, or each id of the list, at event.<field>;
  • lagged runs the snapshot again, resyncing meanwhile.

status moves pending → live; resyncing on a lagged, or when the socket drops until LiveCache::reconnected has asked again.

LiveCache shares one subscription between every reader asking the same snapshot, params, changes and changes params, and keeps it KEEP_MS past its last reader (LiveCache::sweep closes what has waited longer).

Structs§

Crossing
FRAME-20: a move of a module’s collection as a subscriber that last saw move seen receives it — seq the move it now stands at.
Follow
UI-10: a collection that follows its params; dropping it stops that and releases its reader.
Live
A collection as a component reads it.
LiveCache
Every live subscription of the page.
LiveQuery
UI-10: a live as declared, before its params are known: the methods, the key, the folds, and how long its params must be quiet before it runs again.
LiveSpec
A live declaration with its params evaluated: what a subscription is keyed by (snapshot, params, changes, changes params) and how it folds.
ManualClock
The tests’ clock: moves only when told, running each timer that comes due on the way, in order.
ModuleLive
FRAME-19: a module’s collection — LiveCache::follow_held over the spec’s params and when, which the module moves with ModuleLive::update; the registry owns the timing (debounce_ms).
ModuleSpec
FRAME-19: a module’s live spec — LiveSpec::from_value’s keys, plus what rhx’s live has: when (a boolean, true when left out; false holds it — nothing asked) and debounce_ms (how long its params must be quiet before it runs again). when and debounce_ms are not part of what is shared: two modules asking the same spec, held or not, read one collection once both ask.
Reader
One reader of a collection; dropping it releases the subscription (kept KEEP_MS more).

Enums§

Delta
FRAME-20: what crosses to a module when its collection moves — the fold’s own result by key, not the collection.
FoldRule
One on rule.
Status
Where a collection stands.

Constants§

KEEP_MS
How long a subscription outlives its last reader, in milliseconds.

Traits§

Clock
The clock the cache keeps time by, and its timers (UI-10: a live’s debounce_ms).

Functions§

resolve
A live declaration’s params resolved against the props: { "expr" } values evaluated (a prop by name, or a Rhai expression over the props).