View Source ecrn_agent (erlcron v1.2.1)

Agent for cronish testing

Link to this section Summary

Functions

Get job's next execution time
Starts the server with the appropriate job and the appropriate ref
Calculates the duration in milliseconds until the next time a job is to be run.
Validate that a run_when spec specified is correct.

Link to this section Types

-type normalized_period() :: [{integer(), integer(), integer()}].
-type normalized_sched() ::
    {once, {relative | absolute, integer()}} |
    {daily, normalized_period()} |
    {weekly, [integer()], normalized_period()} |
    {monthly, integer(), normalized_period()}.
-type state() :: #state{}.

Link to this section Functions

-spec cancel(pid()) -> ok.
-spec get_datetime(pid()) -> calendar:datetime().
-spec get_datetime(pid(), local | universal) -> calendar:datetime().
-spec next_run(pid()) -> erlang:timestamp().
Get job's next execution time
-spec recalculate(pid()) -> ok.
Link to this function

set_datetime(Pid, DateTime, Actual)

View Source
-spec set_datetime(pid(), calendar:datetime(), erlcron:milliseconds()) -> ok.
Link to this function

set_datetime(Pid, DateTime, Actual, UTC)

View Source
-spec set_datetime(pid(), calendar:datetime(), erlcron:milliseconds(), UTC :: local | universal) ->
                ok | {error, term()}.
Link to this function

start_link(JobRef, Job, JobOpts)

View Source
-spec start_link(erlcron:job_ref(), erlcron:job(), erlcron:job_opts()) ->
              ignore | {error, Reason :: term()} | {ok, pid()}.
Starts the server with the appropriate job and the appropriate ref
Link to this function

until_next_time(NowEpochTime, Sched)

View Source
-spec until_next_time(erlcron:milliseconds(), erlcron:run_when()) -> erlcron:milliseconds().
Calculates the duration in milliseconds until the next time a job is to be run.
-spec validate(erlcron:run_when()) -> ok | {error, term()}.
Validate that a run_when spec specified is correct.