123456789_123456789_123456789_123456789_123456789_

Class: Test::Unit::TestSuiteProcessRunner::Worker

Relationships & Source Files
Inherits: Object
Defined in: lib/test/unit/test-suite-process-runner.rb

Class Attribute Summary

Class Method Summary

Class Attribute Details

.main_to_worker_output (readonly)

[ GitHub ]

  
# File 'lib/test/unit/test-suite-process-runner.rb', line 22

attr_reader :main_to_worker_output, :worker_to_main_input

.worker_to_main_input (readonly)

[ GitHub ]

  
# File 'lib/test/unit/test-suite-process-runner.rb', line 22

attr_reader :main_to_worker_output, :worker_to_main_input

Class Method Details

.initialize(pid, main_to_worker_output, worker_to_main_input)

[ GitHub ]

  
# File 'lib/test/unit/test-suite-process-runner.rb', line 23

def initialize(pid, main_to_worker_output, worker_to_main_input)
  @pid = pid
  @main_to_worker_output = main_to_worker_output
  @worker_to_main_input = worker_to_main_input
end

.receive

[ GitHub ]

  
# File 'lib/test/unit/test-suite-process-runner.rb', line 29

def receive
  Marshal.load(@worker_to_main_input)
end

.send(data)

[ GitHub ]

  
# File 'lib/test/unit/test-suite-process-runner.rb', line 33

def send(data)
  Marshal.dump(data, @main_to_worker_output)
  @main_to_worker_output.flush
end

.wait

[ GitHub ]

  
# File 'lib/test/unit/test-suite-process-runner.rb', line 38

def wait
  begin
    Process.waitpid(@pid)
  ensure
    begin
      @main_to_worker_output.close
    ensure
      @worker_to_main_input.close
    end
  end
end