Class: TestR::Client::Receiver
- Inherits:
-
Thread
- Object
- Thread
- TestR::Client::Receiver
- Defined in:
- lib/testr/client.rb
Direct Known Subclasses
Instance Method Summary collapse
-
#initialize(*popen_args) ⇒ Receiver
constructor
A new instance of Receiver.
- #quit ⇒ Object
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
#quit ⇒ Object
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 |