Class: Gisele::VM::Proxy::Client

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Includes:
Lifecycle, Logging, Robustness
Defined in:
lib/gisele/vm/proxy/client.rb

Instance Attribute Summary collapse

Attributes included from Lifecycle

#last_error, #status

Instance Method Summary collapse

Methods included from Lifecycle

#running?, #shutdown?, #stopped?, #warmup?

Constructor Details

#initialize(options = {}) {|_self| ... } ⇒ Client

Returns a new instance of Client.

Yields:

  • (_self)

Yield Parameters:



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

def initialize(options = {})
  init_lifecycle
  @options  = Proxy.default_options.merge(options)
  @registry = Registry.new(self)
  yield(self) if block_given?
  @logger ||= Logger.new($stdout, Logger::DEBUG)
end

Instance Attribute Details

#loggerObject

Returns the value of attribute logger.



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

def logger
  @logger
end

#optionsObject (readonly)

Returns the value of attribute options.



8
9
10
# File 'lib/gisele/vm/proxy/client.rb', line 8

def options
  @options
end

#registryObject (readonly)

Returns the value of attribute registry.



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

def registry
  @registry
end

Instance Method Details

#run {|@vm| ... } ⇒ Object

Yields:

  • (@vm)


24
25
26
27
28
29
30
# File 'lib/gisele/vm/proxy/client.rb', line 24

def run
  DRb.start_service
  @vm = DRbObject.new nil, options[:uri]
  @vm.to_s
  yield(@vm) if block_given?
  super
end

#stopObject



32
33
34
35
# File 'lib/gisele/vm/proxy/client.rb', line 32

def stop
  DRb.stop_service
  super
end