lib/jcukeforker/task_manager.rb in jcukeforker-0.2.5 vs lib/jcukeforker/task_manager.rb in jcukeforker-0.2.6

- old
+ new

@@ -4,27 +4,33 @@ def initialize(features, opts={}) @features = features @opts = opts @worker_sockets = {} + @failures = false end def on_worker_register(worker_path) @worker_sockets[worker_path] = UNIXSocket.open worker_path pop_task worker_path end def on_task_finished(worker_path, feature, status) + @failures = @failures || !status pop_task worker_path end def on_worker_dead(worker_path) socket = @worker_sockets.delete worker_path socket.close end def close @worker_sockets.each {|k, v| v.close} + end + + def has_failures? + @failures end private def pop_task(worker_path)