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:
13
lib/producer/core/worker.rb
Normal file
13
lib/producer/core/worker.rb
Normal 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
|
Reference in New Issue
Block a user