Package twisted :: Package spread :: Module pb :: Class RemoteReference

[frames | no frames]

## Class RemoteReference

        Ephemeral --+
                    |
    Jellyable --+   |
                |   |
     Serializable --+
                    |
                   RemoteReference

This is a translucent reference to a remote object.

I may be a reference to a `flavors.ViewPoint`, a `flavors.Referenceable`, or an `IPerspective` implementor (e.g., pb.Avatar). From the client's perspective, it is not possible to tell which except by convention.

I am a "translucent" reference because although no additional bookkeeping overhead is given to the application programmer for manipulating a reference, return values are asynchronous.

See also `twisted.internet.defer`.

Method Summary
| ``__init__`(self, perspective, broker, luid, doRefCount)` (internal) Initialize me with a broker and a locally-unique ID.
| ``__cmp__`(self, other)` Compare me [to another `RemoteReference`].
| ``__del__`(self)` Do distributed reference counting on finalization.
| ``__hash__`(self)` Hash me.
| ``_disconnected`(self)` Called if we are disconnected and have callbacks registered.
`twisted.internet.defer.Deferred` | ``callRemote`(self, _name, *args, **kw)` Asynchronously invoke a remote method.
| ``dontNotifyOnDisconnect`(self, callback)` Remove a callback that was registered with notifyOnDisconnect.
| ``jellyFor`(self, jellier)` If I am being sent back to where I came from, serialize as a local backreference.
| ``notifyOnDisconnect`(self, callback)` Register a callback to be called if our broker gets disconnected.
| ``remoteMethod`(self, key)` Get a `RemoteMethod` for this key.
| `unjellyFor(self, unjellier, unjellyList)`
Inherited from Serializable
| ``processUniqueID`(self)` Return an ID which uniquely represents this object for this process.
Inherited from Jellyable
| ``getStateFor`(self, jellier)`
Inherited from Ephemeral
| ``__getstate__`(self)`
| ``__setstate__`(self, state)`

Instance Variable Summary
`Broker` | `broker`: The broker I am obtained through.

Class Variable Summary
`tuple` | `__implements__` = `(<class twisted.spread.interfaces.IUnje...`

Method Details

### __init__(self, perspective, broker, luid, doRefCount)
(Constructor)

(internal) Initialize me with a broker and a locally-unique ID.

The ID is unique only to the particular Perspective Broker instance.

### __cmp__(self, other)
(Comparison operator)

Compare me [to another `RemoteReference`].

### __del__(self)
(Destructor)

Do distributed reference counting on finalization.

### __hash__(self)
(Hashing function)

Hash me.

### _disconnected(self)

Called if we are disconnected and have callbacks registered.

### callRemote(self, _name, *args, **kw)

Asynchronously invoke a remote method.

  Parameters:
    `_name` - the name of the remote method to invoke
    (type=`string`)
    `args` - arguments to serialize for the remote function
    `kw` - keyword arguments to serialize for the remote function.
  Returns:
    a Deferred which will be fired when the result of this remote call is received.
    (type=`twisted.internet.defer.Deferred`)

### dontNotifyOnDisconnect(self, callback)

Remove a callback that was registered with notifyOnDisconnect.

### jellyFor(self, jellier)

If I am being sent back to where I came from, serialize as a local backreference.

  Overrides:
    `twisted.spread.jelly.Jellyable.jellyFor`

### notifyOnDisconnect(self, callback)

Register a callback to be called if our broker gets disconnected.

This callback will be called with one argument, this instance.

### remoteMethod(self, key)

Get a `RemoteMethod` for this key.

Instance Variable Details

### broker

The broker I am obtained through.

  Type:
    `Broker`

Class Variable Details

### __implements__

  Type:
    `tuple`
  Value:

        (<class twisted.spread.interfaces.IUnjellyable at 0x84a65dc>,)

Generated by Epydoc 2.0 on Sat May 15 20:07:45 2004 | http://epydoc.sf.net