johanna v0.1.1 Johanna

Simple wrapper for erlcron, the library providing testable cron like functionality for Erlang systems, with the ability to arbitrarily set the time and place along with fastforwarding through tests.

Summary

Functions

at(time, fun)
at(:erlcron.cron_time | :erlcron.seconds | Time.t, (... -> any)) :: :erlcron.job_ref

Runs the given function once.

Examples

▶ Johanna.once(10, fn -> IO.puts("¡Yay!") end)
▷ ... 10 sec pause
▷ "¡Yay!"

▶ Johanna.datetime()
▷ %DateTime{calendar: Calendar.ISO, day: 30, hour: 14, microsecond: {0, 0},
▷     minute: 2, month: 3, second: 43, std_offset: 0, time_zone: "Etc/UTC",
▷     utc_offset: 0, year: 2017, zone_abbr: "UTC"}
cancel!(job_ref)
cancel!(:erlcron.job_ref) :: :ok | :undefined
datetime()
datetime() :: DateTime.t
datetime!(time)
datetime!(DateTime.t | NaiveDateTime.t) :: :ok
datetimes!(time)
datetimes!(DateTime.t | NaiveDateTime.t) :: :ok
datetimes!(nodes, time)
datetimes!([node], DateTime.t | NaiveDateTime.t) :: :ok
once(time, fun)
once(:erlcron.cron_time | :erlcron.seconds | DateTime.t, (... -> any)) :: :erlcron.job_ref
valid?(spec)
valid?(:erlcron.run_when) :: :valid | :invalid