Module: DTR::Service::Runner

Includes:
Rinda
Included in:
Agent::Runner, TestUnit::DRbTestRunner
Defined in:
lib/dtr/shared/service/runner.rb

Instance Method Summary collapse

Methods included from Rinda

#lookup, #lookup_ring, #start_service, #stop_service

Instance Method Details

#lookup_runnerObject



28
29
30
# File 'lib/dtr/shared/service/runner.rb', line 28

def lookup_runner
  lookup(:take, ['DTR::Runner'.to_sym, nil, nil])[1]
end

#provide_runner(runner) ⇒ Object



22
23
24
25
26
# File 'lib/dtr/shared/service/runner.rb', line 22

def provide_runner(runner)
  tuple = ['DTR::Runner'.to_sym, runner, "DTR remote runner #{Process.pid}-#{runner.name}"]
  #expires after 1 sec for we don't need runner service anymore if there is no one is waiting for taking it
  lookup_ring.write(tuple, 1)
end