123456789_123456789_123456789_123456789_123456789_

Module: ActiveJob::Callbacks

Relationships & Source Files
Namespace Children
Modules:
Extension / Inclusion / Inheritance Descendants
Included In:
ActionMailer::DeliveryJob, ActionMailer::MailDeliveryJob, ActionMailer::Parameterized::DeliveryJob, Base, ::ActiveRecord::DestroyAssociationAsyncJob
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
Instance Chain:
Defined in: activejob/lib/active_job/callbacks.rb

Overview

Active Job provides hooks during the life cycle of a job. Callbacks allow you to trigger logic during this cycle. Available callbacks are:

  • before_enqueue

  • around_enqueue

  • after_enqueue

  • before_perform

  • around_perform

  • after_perform

NOTE: Calling the same callback multiple times will overwrite previous callback definitions.

Constant Summary

::ActiveSupport::Callbacks - Included

CALLBACK_FILTER_TYPES

::ActiveSupport::Callbacks - Attributes & Methods

Class Method Summary

::ActiveSupport::DescendantsTracker - self

clear, descendants, direct_descendants,
store_inherited

This is the only method that is not thread safe, but is only ever called during the eager loading phase.

subclasses

::ActiveSupport::Callbacks - Extended

run_callbacks

Runs the callbacks for the given event.

::ActiveSupport::Concern - Extended

class_methods

Define class methods from given block.

included

Evaluate given block in context of base class, so that you can write class macros here.

prepended

Evaluate given block in context of base class, so that you can write class macros here.

Instance Method Summary

::ActiveSupport::Callbacks - Included

#run_callbacks

Runs the callbacks for the given event.

DSL Calls

included

[ GitHub ]


31
32
33
34
35
36
37
38
39
40
# File 'activejob/lib/active_job/callbacks.rb', line 31

included do
  class_attribute :return_false_on_aborted_enqueue, instance_accessor: false, instance_predicate: false, default: false
  singleton_class.deprecate :return_false_on_aborted_enqueue, :return_false_on_aborted_enqueue=
  cattr_accessor :skip_after_callbacks_if_terminated, instance_accessor: false, default: false

  with_options(skip_after_callbacks_if_terminated: skip_after_callbacks_if_terminated) do
    define_callbacks :perform
    define_callbacks :enqueue
  end
end

Class Attribute Details

.__callbacks (rw)

[ GitHub ]

  
# File 'activesupport/lib/active_support/callbacks.rb', line 67

class_attribute :__callbacks, instance_writer: false, default: {}

.__callbacks?Boolean (rw)

[ GitHub ]

  
# File 'activesupport/lib/active_support/callbacks.rb', line 67

class_attribute :__callbacks, instance_writer: false, default: {}

Instance Attribute Details

#__callbacks (readonly)

[ GitHub ]

  
# File 'activesupport/lib/active_support/callbacks.rb', line 67

class_attribute :__callbacks, instance_writer: false, default: {}

#__callbacks?Boolean (readonly)

[ GitHub ]

  
# File 'activesupport/lib/active_support/callbacks.rb', line 67

class_attribute :__callbacks, instance_writer: false, default: {}