Expand description
The one place this crate reads the wall clock.
Modelled on areev_run::Clock, and for the same reason: a subsystem whose
whole job is time-dependent is untestable if it calls SystemTime::now()
inline. Every decision here — is this due, has the lease expired, when is the
next occurrence — takes now_ms as a value, so a test can step across a cron
boundary or a lease expiry without sleeping.
On the embedded backend the host clock is the database clock, because
there is exactly one writer on one machine. On Postgres, where several nodes
share a memory, readings should come from the server (now()) instead:
skewed node clocks otherwise make triggers fire early, late, or twice, and
that is miserable to debug after the fact.
Structs§
- Fixed
Clock - A clock that returns exactly what a test tells it to.
- System
Clock - The wall clock, with a simulation override.
Traits§
- Clock
- A source of epoch-milliseconds.