Class: Gisele::VM::Proxy::Server

Inherits:
Component show all
Defined in:
lib/gisele/vm/proxy/server.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Component

#connected!, #connected?, #registered, #registered!, #registered?, #unregistered, #vm

Constructor Details

#initialize(options = {}) ⇒ Server

Returns a new instance of Server.



9
10
11
12
# File 'lib/gisele/vm/proxy/server.rb', line 9

def initialize(options = {})
  super()
  @options = Proxy.default_options.merge(options)
end

Instance Attribute Details

#optionsObject (readonly)

Returns the value of attribute options.



7
8
9
# File 'lib/gisele/vm/proxy/server.rb', line 7

def options
  @options
end

Instance Method Details

#connectObject



14
15
16
17
18
# File 'lib/gisele/vm/proxy/server.rb', line 14

def connect
  super
  DRb.start_service options[:uri], vm
  info "VM proxy started at #{DRb.uri}."
end

#disconnectObject



20
21
22
23
24
# File 'lib/gisele/vm/proxy/server.rb', line 20

def disconnect
  DRb.stop_service
  DRb.thread.join if DRb.thread
  super
end