gnomon_clock (gnomon v1.0.0)
View SourceWorker that refreshes the gnomon persistent term once per second. The gnomon application supervises one per node on 64-bit emulators.
It traps exits so terminate/2 erases the value on shutdown; a persistent term outlives its writer, and a stale one is silently wrong. After a kill the supervisor's restart rewrites it, and if the supervisor gives up the application's stop/1 erases it. A clock run instead of the application takes on that cleanup itself.
Ticks use an absolute timer aimed one millisecond past the next system-clock second boundary, so they do not drift. The timer reference is checked on expiry, so a stray tick message is ignored.
Summary
Functions
Starts the worker, linked to the caller and registered locally as gnomon_clock. The persistent term is written before this returns.