Expand description
The driver that gives every active print its periodic observation.
Core decides which prints are owed an observation and writes each one down
(Supervisor::observe_active_prints); this is what asks it to, once per
CoreConfig::observation_interval, and
runs each turn an observation claimed. Each round waits one interval after
the last one finished, as the expiry driver sleeps between its sweeps: the
first is one interval after the server starts rather than at the start, so a
restart is not itself a reason to look, and a slow round is followed by an
interval rather than by a burst of rounds making up for it. A print checked
as it carried on from a planned change is next due one interval after that
check, so the round after it waits only until then
(Supervisor::until_next_observation).
§Why it lives in the server rather than beside the expiry driver
Core’s expiry driver is a thread of its own that polls with no reactor, and the printer port allows that. An observation takes the camera’s frame through the vision port, whose HTTP client needs Tokio’s reactor, so the observation is driven from this server’s runtime — written down and run on blocking threads of it, exactly as the ingress worker writes down an alert and runs the turn it claimed.
§It holds the supervisor weakly
Like the expiry driver, it holds a weak reference, so it stops of its own accord once the last handle to the supervisor is dropped; a server that is stopped also aborts it.
Functions§
- start
- Start observing every active print once per the supervisor’s interval.