Class t.p.b.Broker(banana.Banana, referenceable.Referenceable):

Part of twisted.pb.broker View Source View In Hierarchy

Known subclasses: twisted.pb.broker.LoggingBroker

Implements interfaces: twisted.pb.broker.RIBroker

I manage a connection to a remote Broker.
Instance Variablestubthe PBService which contains us
yourReferenceByCLIDmaps your CLID to a RemoteReferenceData #@ivar yourReferenceByName: maps a per-Tub name to a RemoteReferenceData
yourReferenceByURLmaps a global URL to a RemoteReferenceData
Line # Kind Name Docs
178 Method __init__
182 Method initBroker Undocumented
208 Method setTub Undocumented
213 Method connectionMade Called when a connection is made.
222 Method connectionLost Called when the connection is shut down.
241 Method notifyOnDisconnect Undocumented
243 Method dontNotifyOnDisconnect Undocumented
247 Method getRemoteInterfaceByName 0 Undocumented
252 Method getTrackerForMyReference Undocumented
263 Method getTrackerForMyCall Undocumented
278 Method getTrackerForYourReference The far end holds a Referenceable and has just sent us a reference
305 Method freeYourReference Undocumented
325 Method freeYourReferenceTracker Undocumented
336 Method getMyReferenceByCLID clid is the connection-local ID of the Referenceable the other
353 Method remote_decref Undocumented
365 Method makeGift Undocumented
379 Method remote_decgift Undocumented
391 Method getYourReferenceByName Undocumented
395 Method remote_getReferenceByName Undocumented
401 Method newRequestID Undocumented
406 Method addRequest Undocumented
410 Method removeRequest Undocumented
413 Method getRequest Undocumented
420 Method abandonAllRequests Undocumented
427 Method getRemoteInterfaceByName Undocumented
431 Method getSchemaForMethod Undocumented
441 Method doCall Undocumented
457 Method _callFinished Undocumented
472 Method callFailed Undocumented

Inherited from Banana:

Line # Kind Name Docs
119 Method initSend Undocumented
133 Method send Undocumented
137 Method produce Undocumented
210 Method handleSendViolation Undocumented
255 Method newSlicerFor Undocumented
262 Method pushSlicer Undocumented
308 Method popSlicer Undocumented
315 Method describeSend Undocumented
328 Method setOutgoingVocabulary Undocumented
349 Method sendOpen Undocumented
356 Method sendToken Undocumented
394 Method sendClose Undocumented
398 Method sendAbort Undocumented
402 Method sendError Undocumented
412 Method sendFailed Undocumented
440 Method initReceive Undocumented
462 Method printStack Undocumented
472 Method setObject Undocumented
476 Method getObject Undocumented
484 Method setIncomingVocabulary Undocumented
489 Method dataReceived Called whenever data is received.
509 Method reportReceiveError Undocumented
522 Method handleData Undocumented
811 Method handleOpen Undocumented
851 Method handleToken Undocumented
865 Method handleClose Undocumented
911 Method handleViolation An Unslicer has decided to give up, or we have given up on it
975 Method handleError Undocumented
980 Method describeReceive Undocumented
991 Method receivedObject Decoded objects are delivered here, unless you use a RootUnslicer
997 Method reportViolation Undocumented

Inherited from BaseProtocol (via Banana, Protocol):

Line # Kind Name Docs
325 Method makeConnection Make a connection to a transport and a server.

Inherited from Referenceable:

Line # Kind Name Docs
40 Method getInterface Undocumented
49 Method getInterfaceName Undocumented
53 Method doRemoteCall Invoke the given remote method. This method may raise an

Inherited from OnlyReferenceable (via Referenceable):

Line # Kind Name Docs
25 Method processUniqueID Return a unique identifier (scoped to the process containing the
def __init__(self, params={}):
Parametersfeaturesa dictionary of negotiated connection features
def initBroker(self):
Undocumented
def setTub(self, tub):
Undocumented
def connectionMade(self):

Called when a connection is made.

This may be considered the initializer of the protocol, because it is called when the connection is completed. For clients, this is called once the connection to the server has been established; for servers, this is called after an accept() call stops blocking and a socket has been received. If you need to send any greeting or initial message, do it here.
def connectionLost(self, why):

Called when the connection is shut down.

Clear any circular references here, and any external references to this Protocol. The connection has been closed. The reason Failure wraps a twisted.internet.error.ConnectionDone or twisted.internet.error.ConnectionLost instance (or a subclass of one of those).
Parametersreason(type: twisted.python.failure.Failure )
def notifyOnDisconnect(self, callback):
Undocumented
def dontNotifyOnDisconnect(self, callback):
Undocumented
def getRemoteInterfaceByName 0(self, name):
Undocumented
def getTrackerForMyReference(self, puid, obj):
Undocumented
def getTrackerForMyCall(self, puid, obj):
Undocumented
def getTrackerForYourReference(self, clid, interfaceName=None, url=None):

The far end holds a Referenceable and has just sent us a reference to it (expressed as a small integer). If this is a new reference, they will give us an interface name too, and possibly a global URL for it. Obtain a RemoteReference object (creating it if necessary) to give to the local recipient.

The sender remembers that we hold a reference to their object. When our RemoteReference goes away, we send a decref message to them, so they can possibly free their object.
def freeYourReference(self, tracker, count):
Undocumented
def freeYourReferenceTracker(self, res, tracker):
Undocumented
def getMyReferenceByCLID(self, clid):
clid is the connection-local ID of the Referenceable the other end is trying to invoke or point to. If it is a number, they want an implicitly-created per-connection object that we sent to them at some point in the past. If it is a string, they want an object that was registered with our Factory.
def remote_decref(self, clid, count):
Undocumented
def makeGift(self, rref):
Undocumented
def remote_decgift(self, giftID, count):
Undocumented
def getYourReferenceByName(self, name):
Undocumented
def remote_getReferenceByName(self, name):
Undocumented
def newRequestID(self):
Undocumented
def addRequest(self, req):
Undocumented
def removeRequest(self, req):
Undocumented
def getRequest(self, reqID):
Undocumented
def abandonAllRequests(self, why):
Undocumented
def getRemoteInterfaceByName(self, riname):
Undocumented
def getSchemaForMethod(self, rifaces, methodname):
Undocumented
def doCall(self, reqID, obj, methodname, kwargs, methodSchema):
Undocumented
def _callFinished(self, res, reqID, methodSchema):
Undocumented
def callFailed(self, f, reqID):
Undocumented