Belay.Crons (Belay v1.0.0-rc.6)

Copy Markdown View Source

Runtime cron management, persisted in the database, fired leaderlessly by every node with per-slot dedup — change schedules without deploys.

Belay.Crons.put(MyApp.Belay, "digest", "0 8 * * 1-5", MyApp.Digest,
  input: %{"edition" => "morning"})

Belay.Crons.pause(MyApp.Belay, "digest")
Belay.Crons.resume(MyApp.Belay, "digest")
Belay.Crons.delete(MyApp.Belay, "digest")

Dynamic entries are merged with the static crons: config on every scheduler tick; a dynamic entry with the same name overrides the static one.

Summary

Functions

List dynamic cron entries.

Create or update a cron entry. The expression is validated eagerly.

Functions

delete(name, cron_name)

list(name)

List dynamic cron entries.

pause(name, cron_name)

put(name, cron_name, expression, worker, opts \\ [])

Create or update a cron entry. The expression is validated eagerly.

resume(name, cron_name)