Class: DRbFileServerPlus

Inherits:
Object
  • Object
show all
Defined in:
lib/drb_fileserver_plus.rb

Instance Method Summary collapse

Constructor Details

#initialize(host: 'localhost', port: '61010', nodes: [], sps_host: nil, sps_port: '59010', sps_topic: 'file') ⇒ DRbFileServerPlus

Returns a new instance of DRbFileServerPlus.



140
141
142
143
144
145
146
147
148
149
150
# File 'lib/drb_fileserver_plus.rb', line 140

def initialize(host: 'localhost', port: '61010', nodes: [], sps_host: nil, 
               sps_port: '59010', sps_topic: 'file')

  @host, @port, @nodes = host, port, nodes
  
  if sps_host then
    @sps = SPSPub.new(host: sps_host, port: sps_port) 
    @topic = sps_topic
  end

end

Instance Method Details

#startObject



152
153
154
155
156
157
158
# File 'lib/drb_fileserver_plus.rb', line 152

def start()
  
  DRb.start_service "druby://#{@host}:#{@port}", 
      DRbFileServer.new(@nodes, sps: @sps, topic: @topic)
  DRb.thread.join

end