Class: JCukeForker::TaskManager

Inherits:
AbstractListener show all
Defined in:
lib/jcukeforker/task_manager.rb

Instance Method Summary collapse

Methods inherited from AbstractListener

#on_run_finished, #on_run_interrupted, #on_run_starting, #on_task_starting, #on_worker_dead, #on_worker_waiting, #update

Constructor Details

#initialize(features, io_out, opts = {}) ⇒ TaskManager

Returns a new instance of TaskManager.



5
6
7
8
9
10
# File 'lib/jcukeforker/task_manager.rb', line 5

def initialize(features, io_out, opts={})
  @features = features
  @opts = opts
  @io_out = io_out
  @failures = false
end

Instance Method Details

#closeObject



21
22
23
# File 'lib/jcukeforker/task_manager.rb', line 21

def close
  io_out.close
end

#has_failures?Boolean

Returns:

  • (Boolean)


25
26
27
# File 'lib/jcukeforker/task_manager.rb', line 25

def has_failures?
  @failures
end

#on_task_finished(worker_path, feature, status) ⇒ Object



16
17
18
19
# File 'lib/jcukeforker/task_manager.rb', line 16

def on_task_finished(worker_path, feature, status)
  @failures = @failures || !status
  pop_task worker_path
end

#on_worker_register(worker_path) ⇒ Object



12
13
14
# File 'lib/jcukeforker/task_manager.rb', line 12

def on_worker_register(worker_path)
  pop_task worker_path
end