123456789_123456789_123456789_123456789_123456789_

Module: ActiveJob::Execution

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

::ActiveSupport::Rescuable - Attributes & Methods

Class Method Summary

Instance Method Summary

::ActiveSupport::Rescuable - Included

#rescue_with_handler

Delegates to the class method, but uses the instance as the subject for rescue_from handlers (method calls, instance_exec blocks).

Class Attribute Details

.rescue_handlers (rw)

[ GitHub ]

  
# File 'activesupport/lib/active_support/rescuable.rb', line 13

class_attribute :rescue_handlers, default: []

.rescue_handlers?Boolean (rw)

[ GitHub ]

  
# File 'activesupport/lib/active_support/rescuable.rb', line 13

class_attribute :rescue_handlers, default: []

Instance Attribute Details

#rescue_handlers (rw)

[ GitHub ]

  
# File 'activesupport/lib/active_support/rescuable.rb', line 13

class_attribute :rescue_handlers, default: []

#rescue_handlers?Boolean (rw)

[ GitHub ]

  
# File 'activesupport/lib/active_support/rescuable.rb', line 13

class_attribute :rescue_handlers, default: []

Instance Method Details

#perform

[ GitHub ]

  
# File 'activejob/lib/active_job/execution.rb', line 45

def perform(*)
  fail NotImplementedError
end

#perform_now

Performs the job immediately. The job is not sent to the queueing adapter but directly executed by blocking the execution of others until it’s finished.

MyJob.new(*args).perform_now
[ GitHub ]

  
# File 'activejob/lib/active_job/execution.rb', line 33

def perform_now
  # Guard against jobs that were persisted before we started counting executions by zeroing out nil counters
  self.executions = (executions || 0) + 1

  deserialize_arguments_if_needed
  run_callbacks :perform do
    perform(*arguments)
  end
rescue => exception
  rescue_with_handler(exception) || raise
end