Implement Worker class:

* Move recipe processing code in the worker;
* Refactor CLI and use the the worker;
* Implement Recipe#tasks and remove tasks application during evaluation,
  tasks are now applied by the worker after all evaluations are done.
This commit is contained in:
Thibault Jouan
2013-08-08 01:55:55 +00:00
parent ec44d01c36
commit 0904fa1fc9
9 changed files with 158 additions and 76 deletions

View File

@@ -0,0 +1,13 @@
module Producer
module Core
class Worker
def process(tasks)
tasks.each { |t| process_task t }
end
def process_task(task)
task.actions.each(&:apply)
end
end
end
end