class Minitest::DRb::Server::Executor
Public Class Methods
Source
# File lib/minitest/drb.rb, line 37 def initialize client_count, uri @client_count = client_count @finish_queue = Queue.new @queue = Server.new @finish_queue @pool = [] @url = ::DRb.start_service(uri, @queue).uri @work_finished = nil end
Public Instance Methods
Source
# File lib/minitest/drb.rb, line 59 def shutdown # Shutdown was called which means all work has been added to the # work queue. Push `client_count` poison pills on the work queue # so that each client knows there is no more work to do. @client_count.times { @queue << nil } # Wait until all clients have finished their work and call `finish` # on the server @work_finished.join end
Source
# File lib/minitest/drb.rb, line 47 def start @work_finished = Thread.new do # Read from the finish_queue, client_count times. Then we know # all clients have finished their work @client_count.times { @finish_queue.pop } end end