Durable.Scheduler.DSL (Durable v0.1.0-rc)
View SourceProvides the @schedule decorator for declaring workflow schedules.
Usage
defmodule MyApp.DailyReport do
use Durable
use Durable.Scheduler.DSL
@schedule cron: "0 9 * * *", timezone: "America/New_York"
workflow "generate_report" do
step :fetch_data do
# ...
end
step :generate do
# ...
end
end
endThen register the module in your supervision tree:
{Durable, repo: MyApp.Repo, scheduled_modules: [MyApp.DailyReport]}Options
:cron- Cron expression (required):name- Schedule name (defaults to workflow name):timezone- Timezone for cron evaluation (default: "UTC"):input- Static input for each execution (default: %{}):queue- Queue to run on (default: :default)
Summary
Functions
Injects schedule handling into the calling module.
Called internally to capture the @schedule attribute before a workflow.