Sha256: e543703cd8198f3caafe9f0cc9205899805dca7120e65237fd55b7da485ac100
Contents?: true
Size: 733 Bytes
Versions: 7
Compression:
Stored size: 733 Bytes
Contents
module Henry class ExecutionService # Uri where the service will be listening. DRB_URI = 'druby://localhost' # Range of ports to be used. DRB_PORTS = (8800..9000) # Starts the result service sharing the given result. # # @param [Execution] execution the Execution to be shared. def self.start(execution) 10.times do begin drb_uri = "#{DRB_URI}:#{rand(DRB_PORTS)}" DRb.start_service(drb_uri, execution) ENV['DRB_EXECUTION_URI'] = drb_uri rescue Errno::EADDRINUSE end end return false end # Stops the result service. def self.stop DRb.stop_service rescue return false end end end
Version data entries
7 entries across 7 versions & 1 rubygems