lib/kamerling/task_dispatcher.rb in kamerling-0.0.1 vs lib/kamerling/task_dispatcher.rb in kamerling-0.0.2
- old
+ new
@@ -1,7 +1,7 @@
module Kamerling class TaskDispatcher
- def initialize net_dispatcher: NetDispatcher.new, repos: Repos
+ def initialize net_dispatcher: NetDispatcher, repos: Repos
@net_dispatcher = net_dispatcher
@repos = repos
end
def dispatch
@@ -19,10 +19,10 @@
private
def dispatch_task client: req(:client), project: req(:project),
task: req(:task)
message = Message[client: client, payload: task.data, project: project,
- task: task, type: :DATA]
+ task: task, type: :DATA]
net_dispatcher.dispatch client.addr, message.to_s
client.busy = true
repos << client
end
end end