Class: Megatest::MultiProcess::ClientQueue
- Inherits:
-
Object
- Object
- Megatest::MultiProcess::ClientQueue
- Defined in:
- lib/megatest/multi_process.rb
Instance Method Summary collapse
- #close ⇒ Object
-
#initialize(socket, test_cases_index) ⇒ ClientQueue
constructor
A new instance of ClientQueue.
- #pop_test ⇒ Object
- #record_result(result) ⇒ Object
- #to_io ⇒ Object
Constructor Details
#initialize(socket, test_cases_index) ⇒ ClientQueue
Returns a new instance of ClientQueue.
56 57 58 59 |
# File 'lib/megatest/multi_process.rb', line 56 def initialize(socket, test_cases_index) @socket = socket @test_cases_index = test_cases_index end |
Instance Method Details
#close ⇒ Object
73 74 75 |
# File 'lib/megatest/multi_process.rb', line 73 def close @socket.close end |
#pop_test ⇒ Object
61 62 63 64 65 66 |
# File 'lib/megatest/multi_process.rb', line 61 def pop_test @socket << [:pop] if test_id = @socket.read @test_cases_index.fetch(test_id) end end |
#record_result(result) ⇒ Object
68 69 70 71 |
# File 'lib/megatest/multi_process.rb', line 68 def record_result(result) @socket << [:record, result] @socket.read end |
#to_io ⇒ Object
77 78 79 |
# File 'lib/megatest/multi_process.rb', line 77 def to_io @socket.to_io end |