aboutsummaryrefslogblamecommitdiffstats
path: root/lib/active_job/performing.rb
blob: c3f57873e58fb444214dfb6628ef68c64145bb1e (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
                                  
                              


                   





                                      
                                            
                                                             



                               

                                    






                               
require 'active_support/rescuable'
require 'active_job/arguments'

module ActiveJob
  module Performing
    extend ActiveSupport::Concern
    
    included do
      include ActiveSupport::Rescuable
    end

    def perform_with_hooks(*serialized_args)
      self.arguments = Arguments.deserialize(serialized_args)

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

    def perform(*)
      raise NotImplementedError
    end
  end
end