Previous: , Up: The REMOTE Package   [Contents][Index]


9.1.3 Remote Objects

The wire mechanism only directly supports a limited number of data types for transmission as arguments for remote function calls and as return values: integers inclusively less than 32 bits in length, symbols, lists. Sometimes it is useful to allow remote processes to refer to local data structures without allowing the remote process to operate on the data. We have remote-objects to support this without the need to represent the data structure in terms of the above data types, to send the representation to the remote process, to decode the representation, to later encode it again, and to send it back along the wire.

You can convert any Lisp object into a remote-object. When you send a remote-object along a wire, the system simply sends a unique token for it. In the remote process, the system looks up the token and returns a remote-object for the token. When the remote process needs to refer to the original Lisp object as an argument to a remote call back or as a return value, it uses the remote-object it has which the system converts to the unique token, sending that along the wire to the originating process. Upon receipt in the first process, the system converts the token back to the same (eq) remote-object.

Function: wire:make-remote-object object

make-remote-object returns a remote-object that has object as its value. The remote-object can be passed across wires just like the directly supported wire data types.

Function: wire:remote-object-p object

The function remote-object-p returns t if object is a remote object and nil otherwise.

Function: wire:remote-object-local-p remote

The function remote-object-local-p returns t if remote refers to an object in the local process. This is can only occur if the local process created remote with make-remote-object.

Function: wire:remote-object-eq obj1 obj2

The function remote-object-eq returns t if obj1 and obj2 refer to the same (eq) lisp object, regardless of which process created the remote-objects.

Function: wire:remote-object-value remote

This function returns the original object used to create the given remote object. It is an error if some other process originally created the remote-object.

Function: wire:forget-remote-translation object

This function removes the information and storage necessary to translate remote-objects back into object, so the next gc can reclaim the memory. You should use this when you no longer expect to receive references to object. If some remote process does send a reference to object, remote-object-value signals an error.


Previous: Remote Evaluations, Up: The REMOTE Package   [Contents][Index]