clockblocks.scheduler.TimingBackend
- class clockblocks.scheduler.TimingBackend[source]
Bases:
objectThe scheduler’s pluggable source of “now” and of the condition it uses for waiting.
The scheduler (and therefore an entire clock family) has exactly one timed sleep — the run loop’s wait on
_queue_change_condition(seeScheduler.run()STEP 1c). That condition is sourced from the TimingBackend passed in the constructor, and defaults to a regular condition on a plain lock. Similarly, all timing reads within the scheduler run through timing_backend.now(). The backend therefore defines both how time is perceived and how the scheduler waits.See
CompressedTimefor a backend used to run fast deterministic tests.Methods
A fresh condition variable for the scheduler's run loop to wait on.
now()The backend's current time, in seconds.