ecrn_control (erlcron v1.3.8)
Global clock controller for the erlcron scheduler.
ecrn_control is a singleton gen_server that maintains the reference
datetime used by all job agents. During normal operation the reference
time tracks the real system clock. For testing, the clock can be
advanced to any future point via set_datetime/2; every ecrn_agent
process will then fast-forward, executing any jobs whose scheduled time
falls within the elapsed interval before settling at the new reference
time.
The server also provides the cancel/1 entry point that delegates to
ecrn_reg and is exposed as erlcron:cancel/1.
Summary
Functions
Return the current datetime (universal) with the reference-clock adjustment.
Return the current datetime in universal or local time with the reference-clock adjustment.
Set the scheduler clock to DateTime on the given nodes.
Return the reference datetime (universal) used as the scheduler's clock base.
Return the reference datetime in universal or local time.
Reset the scheduler clock to the current real system time.
Set the scheduler clock to DateTime (local time).
Functions
-spec cancel(erlcron:job_ref()) -> boolean().
-spec datetime() -> {calendar:datetime(), erlcron:milliseconds()}.
Return the current datetime (universal) with the reference-clock adjustment.
-spec datetime(local | universal) -> {calendar:datetime(), erlcron:milliseconds()}.
Return the current datetime in universal or local time with the reference-clock adjustment.
-spec multi_set_datetime([node()], calendar:datetime()) -> {Replies, BadNodes} when Replies :: [{node(), ok | {error, term()}}], BadNodes :: [node()].
Set the scheduler clock to DateTime on the given nodes.
-spec ref_datetime() -> {calendar:datetime(), erlcron:milliseconds()}.
Return the reference datetime (universal) used as the scheduler's clock base.
-spec ref_datetime(local | universal) -> {calendar:datetime(), erlcron:milliseconds()}.
Return the reference datetime in universal or local time.
-spec reset_datetime() -> ok | {error, term()}.
Reset the scheduler clock to the current real system time.
-spec set_datetime(calendar:datetime()) -> ok | {error, term()}.
Set the scheduler clock to DateTime (local time).
-spec set_datetime(calendar:datetime(), local | universal) -> ok | {error, term()}.