SchedEx v0.7.3 SchedEx View Source
SchedEx schedules jobs (either an m,f,a or a function) to run in the future. These jobs are run in isolated processes, and are unsurpervised.
Link to this section Summary
Functions
Cancels the given scheduled job
Runs the given function at the given time
Runs the given module, function and argument at the given time
Runs the given function on every occurence of the given crontab. If func is of arity 1, the scheduled execution time will be passed for each invocation
Runs the given module, function and argument on every occurence of the given crontab. Any
values in the arguments array which are equal to the magic symbol :sched_ex_scheduled_time
are replaced with the scheduled execution time for each invocation
Runs the given function in given number of units (this corresponds to milliseconds
unless a custom time_scale
is specified). If func is of arity 1, the scheduled
execution time will be passed for each invocation
Runs the given module, function and argument in given number of units (this
corresponds to milliseconds unless a custom time_scale
is specified). Any
values in the arguments array which are equal to the magic symbol :sched_ex_scheduled_time
are replaced with the scheduled execution time for each invocation
Returns stats on the given job. Stats are returned for
Link to this section Functions
Cancels the given scheduled job
Runs the given function at the given time
Runs the given module, function and argument at the given time
Runs the given function on every occurence of the given crontab. If func is of arity 1, the scheduled execution time will be passed for each invocation
Supports the following options:
timezone
: A string timezone identifier (America/Chicago
) specifying the timezone within which the crontab should be interpreted. If not specified, defaults toUTC
time_scale
: A module implementing two methods:now/1
, which returns the current time in the specified timezone, andspeedup/0
, which returns an integer factor to speed up delays by. Used mostly for speeding up test runs. If not specified, defaults to an identity module which returns ‘now’, and a factor of 1repeat
: Whether or not this job should be recurring. If false, only the next matching time of the crontab is executed. Defaults to true
Runs the given module, function and argument on every occurence of the given crontab. Any
values in the arguments array which are equal to the magic symbol :sched_ex_scheduled_time
are replaced with the scheduled execution time for each invocation
Supports the following options:
timezone
: A string timezone identifier (America/Chicago
) specifying the timezone within which the crontab should be interpreted. If not specified, defaults toUTC
time_scale
: A module implementing two methods:now/1
, which returns the current time in the specified timezone, andspeedup/0
, which returns an integer factor to speed up delays by. Used mostly for speeding up test runs. If not specified, defaults to an identity module which returns ‘now’, and a factor of 1
Runs the given function in given number of units (this corresponds to milliseconds
unless a custom time_scale
is specified). If func is of arity 1, the scheduled
execution time will be passed for each invocation
Supports the following options:
repeat
: Whether or not this job should be recurring. Defaults to falsestart_time
: ADateTime
to use as the basis to offset fromtime_scale
: A module implementing one method:ms_per_tick/0
, which returns an float number of milliseconds to wait for every unit delay. Used mostly for speeding up test runs. If not specified, defaults to an identity module which returns a value of 1, such that this method runs the job in ‘delay’ ms
Runs the given module, function and argument in given number of units (this
corresponds to milliseconds unless a custom time_scale
is specified). Any
values in the arguments array which are equal to the magic symbol :sched_ex_scheduled_time
are replaced with the scheduled execution time for each invocation
Supports the following options:
repeat
: Whether or not this job should be recurringstart_time
: ADateTime
to use as the basis to offset fromtime_scale
: A module implementing one method:ms_per_tick/0
, which returns an float number of milliseconds to wait for every unit delay. Used mostly for speeding up test runs. If not specified, defaults to an identity module which returns a value of 1, such that this method runs the job in ‘delay’ ms
Returns stats on the given job. Stats are returned for:
scheduling_delay
: The delay between when the job was scheduled to execute, and the time it actually was executed. Based on the quantized scheduled start, and so does not include quantization error. Value specified in microseconds.quantization_error
: Erlang is only capable of scheduling future calls with millisecond precision, so there is some inevitable precision lost between when the job would be scheduled in a perfect world, and how well Erlang is able to schedule the job (ie: to the closest millisecond). This error value captures that difference. Value specified in microseconds.execution_time
: The amount of time the job spent executing. Value specified in microseconds.