Sha256: 95f4df72346aec45a72b2ebddfccb4d80e72c4ee5da73098926ac0080ecfaa72

Contents?: true

Size: 1.43 KB

Versions: 11

Compression:

Stored size: 1.43 KB

Contents

module DeepTest
  module Distributed
    class TestServerWorkers < LocalWorkers
      def initialize(options, test_server_config, connection_info)
        super(options)
        @test_server_config = test_server_config
        @connection_info = connection_info
      end
      
      def number_of_workers
        @test_server_config[:number_of_workers]
      end

      # Here we use DRb to communicate with the RemoteWorkerServer to avoid multiple processes
      # trying to use the same drbfire connection.  We have the RemoteWorkerServer proxy the
      # interaction with Server since the RemoteServerWorker can connect back to the Server trough a NAT.
      def server
        # we're in a new process (one of the workers on the test_server),
        # so stop the old server from RemoteWorkerServer
        DRb.stop_service
        
        # since RemoteWorkerServer now uses drbfire, we use it here to communicate with it
        DRb.start_service(@server_proxy.uri, nil, DRbFire::ROLE => DRbFire::CLIENT)
        
        DeepTest.logger.debug "LocalWorkers start_all worker starting with with blackboard: #{@server_proxy.uri.inspect} #{@server_proxy.inspect}"
        
        # finally, return a remote reference to the RemoteWorkerServer
        DRbObject.new_with_uri(@server_proxy.uri)
      end

      def start_all(server_proxy)
        @server_proxy = server_proxy
        super
        @warlock.exit_when_none_running
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
jason-o-matic-deep_test-1.2.2.10 lib/deep_test/distributed/test_server_workers.rb
jason-o-matic-deep_test-1.2.2.11 lib/deep_test/distributed/test_server_workers.rb
jason-o-matic-deep_test-1.2.2.12 lib/deep_test/distributed/test_server_workers.rb
jason-o-matic-deep_test-1.2.2.13 lib/deep_test/distributed/test_server_workers.rb
jason-o-matic-deep_test-1.2.2.14 lib/deep_test/distributed/test_server_workers.rb
jason-o-matic-deep_test-1.2.2.5 lib/deep_test/distributed/test_server_workers.rb
jason-o-matic-deep_test-1.2.2.6 lib/deep_test/distributed/test_server_workers.rb
jason-o-matic-deep_test-1.2.2.7 lib/deep_test/distributed/test_server_workers.rb
jason-o-matic-deep_test-1.2.2.8 lib/deep_test/distributed/test_server_workers.rb
jason-o-matic-deep_test-1.2.2.9 lib/deep_test/distributed/test_server_workers.rb
jason-o-matic-deep_test-1.2.2.15 lib/deep_test/distributed/test_server_workers.rb