class

ActiveJob::Base

Inherits Reference < Object

Constructors

deserialize(h : Hash(String, ArgValue)) : Base
Source
new(*args)
Source

Class methods

__discard_classes
Source
__retry_rule
Source
default_priority
Source
default_queue_name

DSL defaults (overridden by the macros above).

Source
find_job_class(name : String) : Base.class | Nil

Job-class lookup by name (compile-time registry) — used by recurring tasks and anything resolving class_name strings.

Source
perform_later(*args)
Source
perform_now(*args)
Source
set(*, queue : String | Nil = nil, priority : Int32 | Nil = nil, wait : ActiveSupport::Duration | Time::Span | Nil = nil, wait_until : Time | Nil = nil) : JobSetter

set(queue:, wait:, wait_until:, priority:) — like Rails' JobSetter.

Source

Instance methods

__build_record
Source
__cb_after_enqueue
Source
__cb_after_perform
Source
__cb_around_enqueue(inner : Proc(Nil)) : Nil
Source
__cb_around_perform(inner : Proc(Nil)) : Nil
Source
__cb_before_enqueue
Source
__cb_before_perform

No-op callback defaults.

Source
__enqueue(scheduled : Time | Nil) : Nil
Source
__execute_now
Source
__perform_result

Last perform's return value (perform_now returns it). Limited to scalars — Crystal needs a closed type for the ivar; documented deviation from Ruby's "anything".

__perform_result=(__perform_result : String | Int32 | Int64 | Float64 | Bool | Nil)

Last perform's return value (perform_now returns it). Limited to scalars — Crystal needs a closed type for the ivar; documented deviation from Ruby's "anything".

arguments
arguments=(arguments : Array(ArgValue))
exception_executions
exception_executions=(exception_executions : Hash(String, Int32))
executions
executions=(executions : Int32)
job_id
perform_now

Instance form: run this (possibly deserialized) job with its own stored arguments — Base.deserialize(data).perform_now.

Source
priority
Source
priority=(p : Int32 | Nil)
Source
provider_job_id
provider_job_id=(provider_job_id : String | Nil)
queue_name
Source
queue_name=(name : String)
Source
scheduled_at
scheduled_at=(scheduled_at : Time | Nil)
serialize
Source
successfully_enqueued?
Source

Macros

after_enqueue
Source
after_perform
Source
around_enqueue
Source
around_perform
Source
before_enqueue
Source
before_perform
Source
discard_on(klass)
Source
queue_as(name)
Source
queue_with_priority(value)
Source
retry_on(klass, attempts = 3, wait = 3.seconds)
Source