Class: ActiveSupport::Testing::Parallelization::Server

Inherits:
Object
  • Object
show all
Includes:
DRb::DRbUndumped
Defined in:
lib/active_support/testing/parallelization.rb

Instance Method Summary collapse

Constructor Details

#initializeServer

Returns a new instance of Server.



13
14
15
# File 'lib/active_support/testing/parallelization.rb', line 13

def initialize
  @queue = Queue.new
end

Instance Method Details

#<<(o) ⇒ Object



25
26
27
28
# File 'lib/active_support/testing/parallelization.rb', line 25

def <<(o)
  o[2] = DRbObject.new(o[2]) if o
  @queue << o
end

#lengthObject



30
31
32
# File 'lib/active_support/testing/parallelization.rb', line 30

def length
  @queue.length
end

#popObject



34
# File 'lib/active_support/testing/parallelization.rb', line 34

def pop; @queue.pop; end

#record(reporter, result) ⇒ Object

Raises:

  • (DRb::DRbConnError)


17
18
19
20
21
22
23
# File '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