aboutsummaryrefslogtreecommitdiffstats
path: root/lib/active_job/performing.rb
blob: eca311578d60dd0d8964648580a491dd8f9e8dc1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
require 'active_job/parameters'

module ActiveJob
  module Performing
    def perform_with_deserialization(*serialized_args)
      instrument_performing serialized_args
      perform *Parameters.deserialize(serialized_args)
    end

    def perform(*)
      raise NotImplementedError
    end
    
    private
      def instrument_performing(args)
        ActiveSupport::Notifications.instrument "perform.active_job", adapter: self.class.queue_adapter, job: self.class, args: args
      end
  end
end