Module: DrbmanServer

Defined in:
lib/drb_server/drbman_server.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#nameObject

Returns the value of attribute name.



4
5
6
# File 'lib/drb_server/drbman_server.rb', line 4

def name
  @name
end

Class Method Details

.start_service(klass) ⇒ Object



10
11
12
13
14
15
16
17
18
19
20
# File 'lib/drb_server/drbman_server.rb', line 10

def start_service(klass)
  machine = 'localhost'
  machine = ARGV[0] unless ARGV.length < 1
  port = 9000
  port = ARGV[1] unless ARGV.length < 2
  server = klass.new
  server.name = "druby://#{machine}:#{port}"
  # puts server.inspect
  DRb.start_service(server.name, server)
  DRb.thread.join
end

Instance Method Details

#stop_serviceObject

Stop the DRb service



6
7
8
# File 'lib/drb_server/drbman_server.rb', line 6

def stop_service
  DRb.stop_service
end