Class: TestR::Client::Receiver

Inherits:
Thread
  • Object
show all
Defined in:
lib/testr/client.rb

Direct Known Subclasses

Transceiver

Instance Method Summary collapse

Constructor Details

#initialize(*popen_args) ⇒ Receiver

Returns a new instance of Receiver.



5
6
7
8
# File 'lib/testr/client.rb', line 5

def initialize *popen_args
  (@io = IO.popen(*popen_args)).sync = true
  super() { loop { yield @io.gets } }
end

Instance Method Details

#quitObject



10
11
12
13
14
15
# File 'lib/testr/client.rb', line 10

def quit
  kill # stop receive loop
  Process.kill :SIGTERM, @io.pid
  Process.wait @io.pid # reap zombie
  @io.close # prevent further I/O
end