Table of Contents

Class: ParentService Twisted-0.18.0/twisted/sister/parentserv.py

A `parent' object, managing many sister-servers.

I maintain a list of all "sister" servers who are connected, so that all servers can connect to each other. I also negotiate which distributed objects are owned by which sister servers, so that if any sister-server needs to locate an object it can be made available.

Base Classes   
Service
Perspective
Methods   
__init__
_cbLoaded
_ebLoaded
brokerAttached
brokerDetached
perspectiveMessageReceived
perspective_lockResource
  __init__ 
__init__ (
        self,
        sharedSecret,
        serviceName,
        application=None,
        )

  _cbLoaded 
_cbLoaded (
        self,
        ignored,
        path,
        )

  _ebLoaded 
_ebLoaded (
        self,
        error,
        path,
        )

  brokerAttached 
brokerAttached (
        self,
        cli,
        ident,
        broker,
        )

  brokerDetached 
brokerDetached (
        self,
        cli,
        ident,
        broker,
        )

  perspectiveMessageReceived 
perspectiveMessageReceived (
        self,
        broker,
        message,
        args,
        kw,
        )

A remote message has been received. Dispatch it appropriately.

XXX FIXME this is a temporary workaround because there is no way in the framework to allow passing the broker as an argument to a perspective_ method.

  perspective_lockResource 
perspective_lockResource (
        self,
        broker,
        port,
        path,
        )

Lock a resource.

First, I attempt to locate the resource. If I locate it, I will return its location in the form of a 3-tuple: (host, port, path). A remote reference representing that resource may then be retrieved by doing:

            from twisted.spread import pb, refpath
            pb.connect(host, port, 'sister', secret,
                       'twisted.sister').addCallback(
                       refpath.RemotePathReference, path)

If I do not locate the resource's location immediately, I will ask a low-load server to own the object, and then return the location where I sent it.

Exceptions   
Error( "Unable to locate requesting client..." )

Table of Contents

This document was automatically generated on Sat Jun 1 22:29:23 2002 by HappyDoc version 2.0