Class: Schdlr::Dispatcher

Inherits:
Object
  • Object
show all
Includes:
Concurrent::Async
Defined in:
lib/schdlr/dispatcher.rb

Instance Method Summary collapse

Instance Method Details

#dispatch(task_spec) ⇒ Object



5
6
7
8
9
10
11
12
# File 'lib/schdlr/dispatcher.rb', line 5

def dispatch(task_spec)
  _, _, _, task = *task_spec
  worker = YAML.load(task)
  worker.perform
  return task_spec
rescue => ex
  raise JobFailed.new(task_spec, ex.message)
end