Method: Experiment::WorkServer#initialize

Defined in:
lib/experiment/work_server.rb

#initialize(experiments, options, ip = "localhost") ⇒ WorkServer

Returns a new instance of WorkServer.



7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/experiment/work_server.rb', line 7

def initialize(experiments, options, ip = "localhost")
  uri="druby://#{ip}:8787"
  # The object that handles requests on the server
  front_object = self
  #$SAFE = 1   # disable eval() and friends
  DRb.start_service(uri, front_object)
  
  @experiments = experiments
  @started = @experiments.map { |e| false }
  @done = @started
  @options = options
  @experiment_instances = []
  DRb.thread.join
end