riemann.time.controlled

Provides controllable periodic and deferred execution. Calling (advance! delta-in-seconds) moves the clock forward, triggering events that would have occurred, in sequence.

advance!

(advance! t)

Advances the clock to t seconds, triggering side effects.

clock

Reference to the current time, in seconds.

control-time!

(control-time! f)

Switches riemann.time functions to time.controlled counterparts, invokes f, then restores them. Definitely not threadsafe. Not safe by any standard, come to think of it. Only for testing purposes.

linear-time-controlled

(linear-time-controlled)

reset-clock!

(reset-clock!)

reset-time!

(reset-time! f)(reset-time!)

Resets the clock and task queue. If a function is given, calls f after resetting the time and task list.

set-time!

(set-time! t)

Sets the current time, without triggering callbacks.

unix-time-controlled

(unix-time-controlled)

with-controlled-time!

macro

(with-controlled-time! & body)

Like control-time! but for without the fn callback. Again, not threadsafe; bindings take effect globally.