Belay.Clock behaviour (Belay v2.0.0)

Copy Markdown View Source

Injectable time source. Everything time-dependent in the engine (backoff, lease expiry, rate windows, await deadlines, cron slots) reads through this, so tests advance a Belay.Clock.Sim instead of sleeping.

Summary

Functions

Read the current time from a clock module or {module, argument} pair.

Callbacks

now(term)

@callback now(term()) :: DateTime.t()

Functions

now(mod)

@spec now(module() | {module(), term()}) :: DateTime.t()

Read the current time from a clock module or {module, argument} pair.