View Source AshOban (ash_oban v0.1.3)

Dsl documentation for AshOban

dsl-documentation

DSL Documentation

index

Index

docs

Docs

oban

oban


  • :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.

  • :max_scheduler_attempts (pos_integer/0) - How many times to attempt scheduling of the triggered action. The default value is 1.

  • :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 an on_error action that will make the trigger no longer apply to failed jobs. The default value is 1.

  • :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.

  • :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.

Link to this function

run_trigger(record, trigger)

View Source