Skip to main content

Module clock

Module clock 

Source
Expand description

Clock abstractions for event-driven runtimes. Clock abstractions for event-driven runtimes.

Clock is a resource registered in the World. Handlers read it via Res<Clock>. Sync sources install into the World via the Installer trait and return pollers that sync the clock each poll loop iteration.

Three sync sources:

  • RealtimeClockInstallerRealtimeClockPoller — production
  • TestClockInstallerTestClockPoller — deterministic testing
  • HistoricalClockInstallerHistoricalClockPoller — replay

The RealtimeClockPoller calibration design is inspired by Agrona’s OffsetEpochNanoClock.

Structs§

Clock
The current time — registered as a World resource.
HistoricalClockInstaller
Installer for the historical (replay) clock.
HistoricalClockPoller
Runtime poller for historical (replay) clock — auto-advances per sync.
RealtimeClockInstaller
Installer for the realtime clock. Consumed at setup.
RealtimeClockInstallerBuilder
Builder for RealtimeClockInstaller.
RealtimeClockPoller
Runtime poller for the realtime clock.
TestClockInstaller
Installer for the test clock.
TestClockPoller
Runtime poller for the test clock — manually controlled.

Enums§

ConfigError
Configuration error from clock construction.