Skip to content

Module dev_cron.erl

A device that inserts new messages into the schedule to allow processes to passively 'call' themselves without user interaction.

Function Index

every/3Exported function for scheduling a recurring message.
every_worker_loop/4*
every_worker_loop_test/0*This test verifies that a recurring task can be scheduled and executed.
info/1Exported function for getting device info.
info/3
once/3Exported function for scheduling a one-time message.
once_executed_test/0*This test verifies that a one-time task can be scheduled and executed.
once_worker/3*Internal function for scheduling a one-time message.
parse_time/1*Parse a time string into milliseconds.
stop/3Exported function for stopping a scheduled task.
stop_every_test/0*This test verifies that a recurring task can be stopped by calling the stop function with the task ID.
stop_once_test/0*
test_worker/0*This is a helper function that is used to test the cron device.
test_worker/1*

Function Details

every/3

every(Msg1, Msg2, Opts) -> any()

Exported function for scheduling a recurring message.

every_worker_loop/4 *

every_worker_loop(CronPath, Req, Opts, IntervalMillis) -> any()

every_worker_loop_test/0 *

every_worker_loop_test() -> any()

This test verifies that a recurring task can be scheduled and executed.

info/1

info(X1) -> any()

Exported function for getting device info.

info/3

info(Msg1, Msg2, Opts) -> any()

once/3

once(Msg1, Msg2, Opts) -> any()

Exported function for scheduling a one-time message.

once_executed_test/0 *

once_executed_test() -> any()

This test verifies that a one-time task can be scheduled and executed.

once_worker/3 *

once_worker(Path, Req, Opts) -> any()

Internal function for scheduling a one-time message.

parse_time/1 *

parse_time(BinString) -> any()

Parse a time string into milliseconds.

stop/3

stop(Msg1, Msg2, Opts) -> any()

Exported function for stopping a scheduled task.

stop_every_test/0 *

stop_every_test() -> any()

This test verifies that a recurring task can be stopped by calling the stop function with the task ID.

stop_once_test/0 *

stop_once_test() -> any()

test_worker/0 *

test_worker() -> any()

This is a helper function that is used to test the cron device. It is used to increment a counter and update the state of the worker.

test_worker/1 *

test_worker(State) -> any()