Class: Jobi::Runner
Instance Method Summary collapse
-
#initialize(payload:) ⇒ Runner
constructor
A new instance of Runner.
- #run ⇒ Object
Methods included from Utils
#constantize, #generate_job_id
Constructor Details
#initialize(payload:) ⇒ Runner
Returns a new instance of Runner.
7 8 9 |
# File 'lib/jobi/runner.rb', line 7 def initialize(payload:) = Marshal.load(payload) end |
Instance Method Details
#run ⇒ Object
11 12 13 14 15 16 17 |
# File 'lib/jobi/runner.rb', line 11 def run job = .job_class.new(**.args) job.run job.send(.after_run) if .after_run Jobi.logger.info("Completed in: #{job_duration}") end |