View Source AshOban (ash_oban v0.1.5)
Dsl documentation for AshOban
dsl-documentation
DSL Documentation
index
Index
- oban
- triggers
- trigger
- triggers
docs
Docs
oban
oban
- triggers
- trigger
:api
(atom/0
) - Required. The Api module to use when calling actions on this resource
triggers
triggers
trigger
:name
(atom/0
) - A unique identifier for this trigger.:scheduler_queue
(atom/0
) - The queue to place the scheduler job in. The same queue as job is used by default (but with a priority of 1 so schedulers run first).:scheduler_cron
(String.t/0
) - A crontab configuration for when the job should run. Defaults to once per minute (" "). The default value is `" "`.:queue
(atom/0
) - The queue to place the worker job in. The trigger name is used by default.:record_limit
(pos_integer/0
) - If set, any given run of the scheduler will only ever schedule this many items maximum:max_scheduler_attempts
(pos_integer/0
) - How many times to attempt scheduling of the triggered action. The default value is1
.:max_attempts
(pos_integer/0
) - How many times to attempt the job.
Keep in mind: after all of these attempts, the scheduler will likely just reschedule the job, leading to infinite retries. To solve for this, configure anon_error
action that will make the trigger no longer apply to failed jobs. The default value is1
.:state
- Describes the state of the cron job.
See the getting started guide for an explanation on the need for this field. The most important thing is that you do not remove a trigger from a resource. Oban's cron jobs are persisted, meaning you will get repeated errors whenever the cron job tries to fire. Valid values are :active, :paused, :deleted The default value is:active
.:read_action
(atom/0
) - The read action to use when querying records. Defaults to the primary read.
This action must support keyset pagination.:worker_read_action
(atom/0
) - The read action to use when fetching the individual records for the trigger.
This defaults toread_action
, allowing us to discard records that are no longer relevant. You may need to change this, and if so make sure your action handles the scenario where the trigger is no longer relevant.:action
(atom/0
) - Required. The action to be triggered. Defaults to the identifier of the resource plus the name of the trigger:where
(term/0
) - The filter expression to determine if something should be triggered:on_error
(atom/0
) - An update action to call after the last attempt has failed. See the getting started guide for more.
Link to this section Summary
Functions
Alters your oban configuration to include the required AshOban configuration.
Link to this section Functions
Alters your oban configuration to include the required AshOban configuration.