Skip to main content

Module build_progress

Module build_progress 

Source
Expand description

Build progress: where a running build is, for a renderer on another thread — what rete build|merge|recard --progress draws.

crate::build_trace records what a build did, on the build’s own thread, for the build record. This is its live sibling: the builders publish the phase they enter, how far through it they are, and a few running totals into process-wide atomics, which a renderer samples whenever it likes.

Nothing is published until someone listens. Until then every call is one relaxed atomic load and a branch, and a Ticker — the per-record counter the hot loops use — adds to a local integer and publishes once per Ticker::EVERY records. On wasm32 every function is a no-op.

The figures are progress, not accounting: a phase’s done may stop short of its total (a deduplicating merge reads fewer records than were spilled), and a renderer clamps it to the total.

Structs§

Listener
Publishes for as long as it lives; see listen.
Snapshot
One sample of the published state.
Ticker
A per-record counter for a hot loop: tick adds to a local integer and publishes (advance) once per Self::EVERY records, and what is left when it is dropped.

Enums§

Stat
Running totals a renderer shows beside the phase.
Unit
What a phase’s done and total count.

Functions§

advance
Add n to the current phase’s done.
begin
Enter phase: done restarts at 0 against total (None when nothing bounds it).
listen
Start publishing, from a clean slate. Builds that run while the returned guard lives publish their progress; drop it to stop.
listening
True while a Listener lives.
set_done
Set the current phase’s done.
set_spill_dir
Name the directory the build spills into (None once it is gone), so a renderer can show how much it holds.
set_stat
Set a running total.
set_total
Set the current phase’s total once it is known.
snapshot
Read the published state. The phase, its done, total and unit are read as one: a sample never pairs a new phase with the last one’s figures.