class DRb::DRbIdConv
and DRbNameIdConv in sample/name.rb in the full drb distribution.
For alternative mechanisms, see DRb::TimerIdConv in drb/timeridconv.rb
within the server runtime.
drb remains valid only while that object instance remains alive
__id__ as its id. This means that an object’s identification over
This, the default implementation, uses an object’s local ObjectSpace
Class responsible for converting between an object and its id.
def to_id(obj)
This implementation returns the object's __id__ in the local
Convert an object into a reference id.
def to_id(obj) case obj when Object obj.nil? ? nil : obj.__id__ when BasicObject obj.__id__ end end
def to_obj(ref)
This implementation looks up the reference id in the local object
Convert an object reference id to an object.
def to_obj(ref) ObjectSpace._id2ref(ref) end