Module erlcron

Copyright © Erlware, LLC. All Rights Reserved. This file is provided to you under the BSD License; you may not use this file except in compliance with the License.

Data Types

callable()

callable() = {M::module(), F::atom(), A::[term()]} | function()

constraint()

constraint() = {between, cron_time(), cron_time()}

cron_time()

cron_time() = {integer(), am | pm} | {integer(), integer(), am | pm} | calendar:time()

dom()

dom() = integer()

dow()

dow() = mon | tue | wed | thu | fri | sat | sun

duration()

duration() = {integer(), hr | min | sec}

job()

job() = {run_when(), callable()}

job_ref()

job_ref() = reference()

period()

period() = cron_time() | {every, duration(), constraint()}

run_when()

run_when() = {once, cron_time()} | {once, seconds()} | {daily, period()} | {weekly, dow(), period()} | {monthly, dom(), period()}

seconds()

seconds() = integer()

Function Index

at/2 Convienience method to specify a job run to run on a daily basis at a specific time.
cancel/1 Cancel the job specified by the jobref.
cron/1 Adds a new job to the cron system.
datetime/0 Get the current date time of the running erlcron system.
multi_set_datetime/1 Set the current date time of the erlcron system running on different nodes.
multi_set_datetime/2 Set the current date time of the erlcron system running on the specified nodes.
once/2 Run the specified job once after the amount of time specifed.
set_datetime/1 Set the current date time of the running erlcron system.
validate/1 Check that the spec specified is valid or invalid.

Function Details

at/2

at(When::cron_time() | seconds(), Fun::function()) -> job_ref()

Convienience method to specify a job run to run on a daily basis at a specific time.

cancel/1

cancel(JobRef::job_ref()) -> ok | undefined

Cancel the job specified by the jobref.

cron/1

cron(Job::job()) -> job_ref()

Adds a new job to the cron system. Jobs are described in the job() spec. It returns the JobRef that can be used to manipulate the job after it is created.

datetime/0

datetime() -> {calendar:datetime(), seconds()}

Get the current date time of the running erlcron system.

multi_set_datetime/1

multi_set_datetime(DateTime::calendar:datetime()) -> ok

Set the current date time of the erlcron system running on different nodes.

multi_set_datetime/2

multi_set_datetime(Nodes::[node()], DateTime::calendar:datetime()) -> ok

Set the current date time of the erlcron system running on the specified nodes

once/2

once(When::cron_time() | seconds(), Fun::function()) -> job_ref()

Run the specified job once after the amount of time specifed.

set_datetime/1

set_datetime(DateTime::calendar:datetime()) -> ok

Set the current date time of the running erlcron system.

validate/1

validate(Spec::run_when()) -> valid | invalid

Check that the spec specified is valid or invalid


Generated by EDoc