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:
self,
::ActiveSupport::Concern
|
|
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
- #perform_now
- #_perform_job private
- #halted_callback_hook private
- #instrument(operation, payload = {}, &block) private
DSL Calls
included
[ GitHub ]19 20 21 22 23
# File 'activejob/lib/active_job/instrumentation.rb', line 19
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 30
def _perform_job instrument(:perform_start) super end
#halted_callback_hook (private)
[ GitHub ]# File 'activejob/lib/active_job/instrumentation.rb', line 47
def halted_callback_hook(*) super @_halted_callback_hook_called = true end
#instrument(operation, payload = {}, &block) (private)
[ GitHub ]# File 'activejob/lib/active_job/instrumentation.rb', line 35
def instrument(operation, payload = {}, &block) payload[:job] = self payload[:adapter] = queue_adapter ActiveSupport::Notifications.instrument("#{operation}.active_job", payload) do value = block.call if block payload[:aborted] = @_halted_callback_hook_called if defined?(@_halted_callback_hook_called) @_halted_callback_hook_called = nil value end end
#perform_now
[ GitHub ]# File 'activejob/lib/active_job/instrumentation.rb', line 25
def perform_now instrument(:perform) { super } end