Module: ActiveJob::Execution::ClassMethods

Defined in:
activejob/lib/active_job/execution.rb

Overview

Includes methods for executing and performing jobs instantly.

Instance Method Summary collapse

Instance Method Details

#execute(job_data) ⇒ Object

:nodoc:


22
23
24
25
26
27
# File 'activejob/lib/active_job/execution.rb', line 22

def execute(job_data) #:nodoc:
  ActiveJob::Callbacks.run_callbacks(:execute) do
    job = deserialize(job_data)
    job.perform_now
  end
end

#perform_now(*args) ⇒ Object

Performs the job immediately.

MyJob.perform_now("mike")

17
18
19
# File 'activejob/lib/active_job/execution.rb', line 17

def perform_now(*args)
  job_or_instantiate(*args).perform_now
end