Class: Kindly::Runner
- Inherits:
-
Object
- Object
- Kindly::Runner
- Defined in:
- lib/kindly/runner.rb
Instance Method Summary collapse
-
#initialize ⇒ Runner
constructor
A new instance of Runner.
- #run(job_name) ⇒ Object
Constructor Details
Instance Method Details
#run(job_name) ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/kindly/runner.rb', line 11 def run(job_name) job_id = @queue.pop(job_name) if job_id.nil? puts "No pending requests for #{job_name}." return false end job = @db.fetch_job(job_name, job_id) run_job(job) job.respond_to?(:output) ? job.output : {} end |