Elixir
periodical
A bounded, in-memory scheduler for recurring and one-time callbacks in one BEAM instance, with overlap and misfire policies, pause, cancellation and telemetry.
Intention
Schedules are Ephemeris rules, so an interval is written as an RRULE or a plain sentence and means the same either way. Everything else stays local and bounded on purpose: schedules disappear with the instance, and every replica runs its own. Work that must be durable or run once across a cluster is handed by the callback to a queue built for that.
Example
defmodule MyApp.Cleanup do
def run(%Periodical.Trigger{} = trigger, scope) do
MyApp.Log.cleanup_started(trigger.schedule_id, scope)
:ok
end
end
{:ok, schedule_id} =
Periodical.every("FREQ=MINUTELY;INTERVAL=5", MyApp.Cleanup, :run, [:expired_sessions])Install
{:periodical, "~> 0.1"}