123456789_123456789_123456789_123456789_123456789_

Module: ActiveJob::Instrumentation

Do not use. This module is for internal use only.
Relationships & Source Files
Extension / Inclusion / Inheritance Descendants
Included In:
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
Defined in: activejob/lib/active_job/instrumentation.rb

Class Method Summary

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

append_features, prepend_features

Instance Method Summary

DSL Calls

included

[ GitHub ]


20
21
22
23
24
# File 'activejob/lib/active_job/instrumentation.rb', line 20

included do
  around_enqueue do |_, block|
    scheduled_at ? instrument(:enqueue_at, &block) : instrument(:enqueue, &block)
  end
end

Instance Method Details

#_perform_job (private)

[ GitHub ]

  
# File 'activejob/lib/active_job/instrumentation.rb', line 43

def _perform_job
  instrument(:perform_start)
  super
end

#halted_callback_hook (private)

[ GitHub ]

  
# File 'activejob/lib/active_job/instrumentation.rb', line 48

def halted_callback_hook(*)
  super
  @_halted_callback_hook_called = true
end

#instrument(operation, payload = {}, &block)

[ GitHub ]

  
# File 'activejob/lib/active_job/instrumentation.rb', line 30

def instrument(operation, payload = {}, &block) # :nodoc:
  payload[:job] = self
  payload[:adapter] = queue_adapter

  ActiveSupport::Notifications.instrument("#{operation}.active_job", payload) do |payload|
    value = block.call(payload) if block
    payload[:aborted] = true if @_halted_callback_hook_called
    @_halted_callback_hook_called = nil
    value
  end
end

#perform_now

[ GitHub ]

  
# File 'activejob/lib/active_job/instrumentation.rb', line 26

def perform_now
  instrument(:perform) { super }
end