Class: Rinda::Tuple

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

Instance Method Summary collapse

Instance Method Details

#init_with_ary(ary) ⇒ Object



22
23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/skynet/skynet_tuplespace_server.rb', line 22

def init_with_ary(ary)
  if ary.instance_of?(DRb::DRbUnknown)
    begin
      Marshal.load(ary.buf)
    rescue Exception => e
      raise Rinda::RindaError.new("DRb couldn't marshall tuple of type #{ary.name}, it was turned into a DRb::DRbUnknown object.\nMarshal exception #{e.inspect}\nOriginal object:\n\t#{ary.buf}.\n\nStacktrace:\n")
    end
  else
    @tuple = Array.new(ary.size)
    @tuple.size.times do |i|
      @tuple[i] = ary[i]
    end
  end
end