AshOban.Info (ash_oban v0.8.11)

Copy Markdown View Source

Introspection for AshOban

Summary

Functions

The Domain to use when calling actions on this resource. Defaults to the resource's domain.

The Domain to use when calling actions on this resource. Defaults to the resource's domain.

A list of tenants or a function behaviour that returns a list of tenants a trigger should be run for. Can be overwritten on the trigger level.

A list of tenants or a function behaviour that returns a list of tenants a trigger should be run for. Can be overwritten on the trigger level.

oban.scheduled_actions DSL entities

Determines which context keys are placed in shared context instead of regular context. Shared context propagates to related actions called via manage_relationship and can be passed to other action invocations using the context as scope, making it easier to detect AshOban execution in nested actions.

Determines which context keys are placed in shared context instead of regular context. Shared context propagates to related actions called via manage_relationship and can be passed to other action invocations using the context as scope, making it easier to detect AshOban execution in nested actions.

Deprecated: Use shared_context instead. shared_context? true is equivalent to shared_context :all.

oban.triggers DSL entities

Default value for use_tenant_from_record? for all triggers in this resource. When set to true, tenants will be extracted from each record's tenant attribute and used when workers process those records. This allows schedulers to use multitenancy :allow_global read actions to find records across all tenants, while worker actions still run with the correct tenant context for each record.

Functions

oban_domain(dsl_or_extended)

@spec oban_domain(dsl_or_extended :: module() | map()) :: {:ok, module()} | :error

The Domain to use when calling actions on this resource. Defaults to the resource's domain.

oban_domain!(dsl_or_extended)

@spec oban_domain!(dsl_or_extended :: module() | map()) :: module() | no_return()

The Domain to use when calling actions on this resource. Defaults to the resource's domain.

oban_list_tenants(dsl_or_extended)

@spec oban_list_tenants(dsl_or_extended :: module() | map()) ::
  {:ok, [any()] | module() | tuple() | (-> any())} | :error

A list of tenants or a function behaviour that returns a list of tenants a trigger should be run for. Can be overwritten on the trigger level.

oban_list_tenants!(dsl_or_extended)

@spec oban_list_tenants!(dsl_or_extended :: module() | map()) ::
  ([any()] | module() | tuple() | (-> any())) | no_return()

A list of tenants or a function behaviour that returns a list of tenants a trigger should be run for. Can be overwritten on the trigger level.

oban_options(dsl_or_extended)

@spec oban_options(dsl_or_extended :: module() | map()) :: %{
  required(atom()) => any()
}

oban DSL options

Returns a map containing the and any configured or default values.

oban_scheduled_action(resource, name)

@spec oban_scheduled_action(Ash.Resource.t() | Spark.Dsl.t(), atom()) ::
  nil | AshOban.Schedule.t()

oban_scheduled_actions(dsl_or_extended)

@spec oban_scheduled_actions(dsl_or_extended :: module() | map()) :: [struct()]

oban.scheduled_actions DSL entities

oban_shared_context(dsl_or_extended)

@spec oban_shared_context(dsl_or_extended :: module() | map()) ::
  {:ok, :all | [:job | :ash_oban?]} | :error

Determines which context keys are placed in shared context instead of regular context. Shared context propagates to related actions called via manage_relationship and can be passed to other action invocations using the context as scope, making it easier to detect AshOban execution in nested actions.

Valid keys:

  • :ash_oban? - the ash_oban?: true private flag
  • :job - the ash_oban: %{job: job} context data

Use :all to share all keys (equivalent to the old shared_context? true).

We recommend shared_context [:job] for most use cases.

Can be overridden per trigger or scheduled action.

If not specified at any level, falls back to Application.get_env(:ash_oban, :shared_context).

oban_shared_context!(dsl_or_extended)

@spec oban_shared_context!(dsl_or_extended :: module() | map()) ::
  (:all | [:job | :ash_oban?]) | no_return()

Determines which context keys are placed in shared context instead of regular context. Shared context propagates to related actions called via manage_relationship and can be passed to other action invocations using the context as scope, making it easier to detect AshOban execution in nested actions.

Valid keys:

  • :ash_oban? - the ash_oban?: true private flag
  • :job - the ash_oban: %{job: job} context data

Use :all to share all keys (equivalent to the old shared_context? true).

We recommend shared_context [:job] for most use cases.

Can be overridden per trigger or scheduled action.

If not specified at any level, falls back to Application.get_env(:ash_oban, :shared_context).

oban_shared_context?(dsl_or_extended)

@spec oban_shared_context?(dsl_or_extended :: module() | map()) :: boolean()

Deprecated: Use shared_context instead. shared_context? true is equivalent to shared_context :all.

oban_trigger(resource, name)

@spec oban_trigger(Ash.Resource.t() | Spark.Dsl.t(), atom()) ::
  nil | AshOban.Trigger.t()

oban_triggers(dsl_or_extended)

@spec oban_triggers(dsl_or_extended :: module() | map()) :: [struct()]

oban.triggers DSL entities

oban_triggers_and_scheduled_actions(resource)

@spec oban_triggers_and_scheduled_actions(Ash.Resource.t() | Spark.Dsl.t()) :: [
  AshOban.Trigger.t() | AshOban.Schedule.t()
]

oban_use_tenant_from_record?(dsl_or_extended)

@spec oban_use_tenant_from_record?(dsl_or_extended :: module() | map()) :: boolean()

Default value for use_tenant_from_record? for all triggers in this resource. When set to true, tenants will be extracted from each record's tenant attribute and used when workers process those records. This allows schedulers to use multitenancy :allow_global read actions to find records across all tenants, while worker actions still run with the correct tenant context for each record.

Can be overridden per trigger.

pro?()

@spec pro?() :: boolean()