Class: DTR::DRbObjectWrapper

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

Instance Method Summary collapse

Constructor Details

#initialize(uri) ⇒ DRbObjectWrapper

Returns a new instance of DRbObjectWrapper.



8
9
10
# File 'lib/dtr/drb_dtr.rb', line 8

def initialize(uri)
  @uri = uri
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method, *args, &block) ⇒ Object



12
13
14
15
16
17
# File 'lib/dtr/drb_dtr.rb', line 12

def method_missing(method, *args, &block)
  (@drbo ||= DRbObject.new_with_uri(@uri)).send(method, *args, &block)
rescue DRb::DRbConnError => e
  logger.info { "DRb #{@uri} is not alive!" }
  nil
end