123456789_123456789_123456789_123456789_123456789_

Class: DRb::DRbObjectSpace

Do not use. This class is for internal use only.
Relationships & Source Files
Super Chains via Extension / Inclusion / Inheritance
Instance Chain:
self, MonitorMixin
Inherits: Object
Defined in: lib/drb/drb.rb

Class Method Summary

Instance Method Summary

Constructor Details

.newDRbObjectSpace

[ GitHub ]

  
# File 'lib/drb/drb.rb', line 357

def initialize
  super()
  @map = ObjectSpace::WeakMap.new
end

Instance Method Details

#to_id(obj)

[ GitHub ]

  
# File 'lib/drb/drb.rb', line 362

def to_id(obj)
  synchronize do
    @map[obj.__id__] = obj
    obj.__id__
  end
end

#to_obj(ref)

[ GitHub ]

  
# File 'lib/drb/drb.rb', line 369

def to_obj(ref)
  synchronize do
    obj = @map[ref]
    raise RangeError.new("invalid reference") unless obj.__id__ == ref
    obj
  end
end