Class: Spec::Distributed::RindaMasterRunner

Inherits:
MasterRunner
  • Object
show all
Includes:
TupleArgs
Defined in:
lib/spec/distributed/rinda_master_runner.rb

Instance Method Summary collapse

Methods included from TupleArgs

#process_tuple_args, #tuples

Methods inherited from MasterRunner

#initialize, #run_behaviours

Constructor Details

This class inherits a constructor from Spec::Distributed::MasterRunner

Instance Method Details

#process_args(args) ⇒ Object



7
8
9
# File 'lib/spec/distributed/rinda_master_runner.rb', line 7

def process_args(args)
  process_tuple_args(args)
end

#run(paths, exit_when_done) ⇒ Object



11
12
13
14
15
16
17
18
19
20
# File 'lib/spec/distributed/rinda_master_runner.rb', line 11

def run(paths, exit_when_done)
  DRb.start_service
  begin
    @ring_server = Rinda::RingFinger.primary
  rescue Exception => e
    puts "Could not find the RingServer. Please make sure there is at least one slave running"
    exit
  end
  super
end

#slave_runnersObject



22
23
24
25
26
27
# File 'lib/spec/distributed/rinda_master_runner.rb', line 22

def slave_runners
  puts "Looking for slaves with tuple #{tuples.inspect}"
  slaves = @ring_server.read_all tuples
  puts "Found #{slaves.length} slaves"
  slaves.map { |s| @ring_server.take(s); s[2] }
end