jonnify·echd /echd/bus/workshop/the-cron-re-minted

echd — Echo on Encore · E3.4 · dive

The Cron, Re-minted

Where a cron fires an anonymous function, EchoMQ.Repeat mints a fresh branded job each occurrence — run it and read two distinct ids where a cron would leave one nameless tick.

Vision · real substrate

echd speaks in the present tense over a build ladder. Every module, verb, key, and port named on this page is real; the composition into one standing platform is the vision the ladder builds.

§1

The dive

docs/echo_mq/specs/emq1/emq.1/emq.1.md:13-44

An Encore cron entry is a timer bound to a function: when the schedule fires, the function runs, and the run leaves nothing behind. Re-minting it changes what an occurrence is. You register EchoMQ.Repeat with the same schedule, and now each occurrence is not a function call but a fresh branded JOB — 02:00 today is one id, 02:00 tomorrow another. The schedule becomes a rule for minting, and the mint is a first-class job with its own attempts, its own lease, and its own place in metrics.

Run it and the abstract claim becomes two ids you can read. Register the recurrence, let two occurrences come due, and inspect the ready set: two distinct jobs, not one action fired twice. Fail one on purpose and it retries on its own attempts clock while the other proceeds untouched — proof that the occurrences are independent. And because a supervised pump, EchoMQ.Pump, promotes each due occurrence exactly once on the server's clock, the re-minted cron fires on time and once, whatever any caller's wall clock believes.

§2

Cron fires; Repeat mints

docs/echo_mq/specs/emq1/emq.1/emq.1.md:13-44
An Encore cron, re-minted as a branded job · hover to read
an Encore cron, re-minted as a branded job cron @ 02:00 fires f() — an anonymous tick: no id, no retry EchoMQ.Repeat JOB a · occ 1 JOB b · occ 2 the Pump promotes each occurrence once, on the server clock
The cron. An Encore cron entry runs a function on a timer. When 02:00 comes it fires f() and that is all — no id to name the run, no attempts to retry it, no record beyond a log line. The action is anonymous, and an anonymous action cannot be recovered.
The re-mint. Register EchoMQ.Repeat with the same schedule and each occurrence mints a fresh branded JOB: 02:00 today is one id, 02:00 tomorrow another. Inspect them and they are two distinct jobs with their own attempts — one can fail and retry without touching the other.
The promote. A supervised pump, EchoMQ.Pump, sweeps the schedule set on the server's clock and promotes each due occurrence once. "Due" is the bus's decision, not a caller's wall clock, so the re-minted cron fires on time and one time, whatever the caller's machine thinks.

Hover or focus a part to read it; click to pin. Without scripting, all three read in sequence.

§3

Run it, and read the two ids

docs/echo_mq/specs/emq1/emq.1/emq.1.md:13-44

The whole argument for re-minting fits in one observation you can make at a terminal: after two occurrences come due, the ready set holds two different branded ids, and a cron would have left none. That difference is not cosmetic. A named job can be tracked in metrics, retried on its own attempts clock, inspected in the morgue when it dies, and reasoned about after the fact. A cron tick can be none of these, because it has no identity to hang any of them on.

The subtlety worth watching in the run is exactly once per occurrence. The Pump must promote a given occurrence a single time — not zero times if the sweep is late, not twice if it overlaps — and it does so by treating the schedule set as a scored, server-clock-gated fence and moving each due entry atomically. Advance the clock, watch one fresh mint appear per occurrence and no more, and you have seen the property that lets recurring work join the ordinary lifecycle of the bus: minted, promoted, claimed, retried, archived — a schedule that produces jobs instead of firing ticks.

§4

The rule

one line to carry

The re-minting rule — a cron becomes a Repeat registration whose every occurrence is a fresh branded job, promoted once on the server clock. Run it and read two distinct ids where a cron would have left one anonymous tick — each retryable on its own, each promoted exactly once, each a job the platform can see.

§5

Doors

the scheduler, in depth
§6

References

sources · related

Sources

Related