123456789_123456789_123456789_123456789_123456789_

Module: ActiveJob::Callbacks

Relationships & Source Files
Namespace Children
Modules:
Extension / Inclusion / Inheritance Descendants
Included In:
ActionMailer::MailDeliveryJob, 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

descendants

See additional method definition at line 104.

subclasses

See additional method definition at line 100.

::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 ]


30
31
32
33
# File 'activejob/lib/active_job/callbacks.rb', line 30

included do
  define_callbacks :perform, skip_after_callbacks_if_terminated: true
  define_callbacks :enqueue, skip_after_callbacks_if_terminated: true
end

Class Attribute Details

.__callbacks (rw)

[ GitHub ]

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

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

.__callbacks?Boolean (rw)

[ GitHub ]

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

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

Instance Attribute Details

#__callbacks (readonly)

[ GitHub ]

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

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

#__callbacks?Boolean (readonly)

[ GitHub ]

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

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