Class: ActiveSupport::Testing::Parallelization::Server
- Includes:
- DRb::DRbUndumped
- Defined in:
- activesupport/lib/active_support/testing/parallelization.rb
Instance Method Summary collapse
- #<<(o) ⇒ Object
-
#initialize ⇒ Server
constructor
A new instance of Server.
- #length ⇒ Object
- #pop ⇒ Object
- #record(reporter, result) ⇒ Object
Constructor Details
#initialize ⇒ Server
Returns a new instance of Server.
13 14 15 |
# File 'activesupport/lib/active_support/testing/parallelization.rb', line 13 def initialize @queue = Queue.new end |
Instance Method Details
#<<(o) ⇒ Object
25 26 27 28 |
# File 'activesupport/lib/active_support/testing/parallelization.rb', line 25 def <<(o) o[2] = DRbObject.new(o[2]) if o @queue << o end |
#length ⇒ Object
30 31 32 |
# File 'activesupport/lib/active_support/testing/parallelization.rb', line 30 def length @queue.length end |
#pop ⇒ Object
34 |
# File 'activesupport/lib/active_support/testing/parallelization.rb', line 34 def pop; @queue.pop; end |
#record(reporter, result) ⇒ Object
17 18 19 20 21 22 23 |
# File 'activesupport/lib/active_support/testing/parallelization.rb', line 17 def record(reporter, result) raise DRb::DRbConnError if result.is_a?(DRb::DRbUnknown) reporter.synchronize do reporter.record(result) end end |