class documentation

class twisted.spread.pb.Broker(banana.Banana): (source)

Known subclasses: twisted.mail.pb.MaildirBroker, twisted.mail.pb.MaildirClient

View In Hierarchy

I am a broker for objects.

Class Variable version Undocumented
Class Variable username Undocumented
Class Variable factory Undocumented
Method __init__ Undocumented
Instance Variable disconnected Undocumented
Instance Variable disconnects Undocumented
Instance Variable failures Undocumented
Instance Variable connects Undocumented
Instance Variable localObjects Undocumented
Instance Variable security Undocumented
Instance Variable pageProducers Undocumented
Instance Variable currentRequestID Undocumented
Instance Variable currentLocalID Undocumented
Instance Variable unserializingPerspective Undocumented
Instance Variable luids Undocumented
Instance Variable remotelyCachedObjects Undocumented
Instance Variable remotelyCachedLUIDs Undocumented
Instance Variable locallyCachedObjects Undocumented
Instance Variable waitingForAnswers Undocumented
Method resumeProducing Called when the consumer attached to me runs out of buffer.
Method pauseProducing Undocumented
Method stopProducing Undocumented
Method registerPageProducer Undocumented
Method expressionReceived Evaluate an expression as it's received.
Method proto_version Protocol message: (version version-number)
Method sendCall Utility method to send an expression to the other side of the connection.
Method proto_didNotUnderstand Respond to stock 'didNotUnderstand' message.
Method connectionReady Initialize. Called after Banana negotiation is done.
Method connectionFailed Undocumented
Method connectionLost The connection was lost.
Instance Variable localSecurity Undocumented
Instance Variable remoteSecurity Undocumented
Method notifyOnDisconnect
Method notifyOnFail
Method notifyOnConnect
Method dontNotifyOnDisconnect
Method localObjectForID Get a local object for a locally unique ID.
Instance Variable maxBrokerRefsViolations Undocumented
Method registerReference Store a persistent reference to a local object and map its id() to a generated, session-unique ID.
Method setNameForLocal Store a special (string) ID for this object.
Method remoteForName Returns an object from the remote name mapping.
Method cachedRemotelyAs No summary
Method remotelyCachedForLUID
Method cacheRemotely XXX
Method cacheLocally (internal)
Method cachedLocallyAs Undocumented
Method serialize Jelly an object according to the remote security rules for this broker.
Instance Variable serializingPerspective Undocumented
Instance Variable jellyMethod Undocumented
Instance Variable jellyArgs Undocumented
Instance Variable jellyKw Undocumented
Method unserialize Unjelly an sexp according to the local security rules for this broker.
Method newLocalID
Method newRequestID
Method proto_message Undocumented
Method proto_cachemessage Undocumented
Method proto_answer (internal) Got an answer to a previously sent message.
Method proto_error (internal) Deal with an error.
Method sendDecRef (internal) Send a DECREF directive.
Method proto_decref (internal) Decrement the reference count of an object.
Method decCacheRef (internal) Send a DECACHE directive.
Method proto_decache (internal) Decrement the reference count of a cached object.
Method proto_uncache (internal) Tell the client it is now OK to uncache an object.
Instance Variable _localCleanup Undocumented
Method _sendMessage Undocumented
Method _recvMessage Received a message-send.
Method _sendAnswer (internal) Send an answer to a previously sent message.
Method _sendFailureOrError Call _sendError or _sendFailure, depending on whether fail represents an Error subclass or not.
Method _sendFailure Log error and then send it.
Method _sendError (internal) Send an error for a previously sent message.

Inherited from Banana:

Instance Variable knownDialects These are the profiles supported by this Banana implementation.
Instance Variable prefixLimit Undocumented
Method setPrefixLimit Set the prefix limit for decoding done by this protocol instance.
Instance Variable currentDialect Undocumented
Method callExpressionReceived Undocumented
Method connectionMade Called when a connection is made.
Method gotItem Undocumented
Instance Variable buffer Undocumented
Method dataReceived Called whenever data is received.
Class Variable outgoingVocabulary Undocumented
Class Variable incomingVocabulary Undocumented
Instance Variable listStack Undocumented
Instance Variable outgoingSymbols Undocumented
Instance Variable outgoingSymbolCount Undocumented
Instance Variable isClient Undocumented
Method sendEncoded Send the encoded representation of the given object:
Instance Variable _smallestLongInt Undocumented
Instance Variable _smallestInt Undocumented
Instance Variable _largestInt Undocumented
Instance Variable _largestLongInt Undocumented
Method _selectDialect Undocumented
Method _encode Undocumented

Inherited from Protocol (via Banana):

Method logPrefix Return a prefix matching the class name, to identify log messages related to this protocol instance.

Inherited from BaseProtocol (via Banana, Protocol):

Instance Variable connected Undocumented
Instance Variable transport Undocumented
Method makeConnection Make a connection to a transport and a server.

Inherited from Ephemeral (via Banana):

Method __reduce__ Serialize any subclass of Ephemeral in a way which replaces it with Ephemeral itself.
Method __getstate__ Undocumented
Method __setstate__ Undocumented
Instance Variable __class__ Undocumented
version = (source)

Undocumented

(type: int)
username = (source)

Undocumented

def __init__(self, isClient=1, security=globalSecurity): (source)

Undocumented

disconnected = (source)

Undocumented

(type: int)
disconnects = (source)

Undocumented

failures = (source)

Undocumented

connects = (source)

Undocumented

localObjects = (source)

Undocumented

security = (source)

Undocumented

pageProducers = (source)

Undocumented

(type: list)
currentRequestID = (source)

Undocumented

currentLocalID = (source)

Undocumented

unserializingPerspective = (source)

Undocumented

luids = (source)

Undocumented

remotelyCachedObjects = (source)

Undocumented

remotelyCachedLUIDs = (source)

Undocumented

locallyCachedObjects = (source)

Undocumented

waitingForAnswers = (source)

Undocumented

_localCleanup = (source)

Undocumented

(type: dict)
def resumeProducing(self): (source)

Called when the consumer attached to me runs out of buffer.

def pauseProducing(self): (source)

Undocumented

def stopProducing(self): (source)

Undocumented

def registerPageProducer(self, pager): (source)

Undocumented

def expressionReceived(self, sexp): (source)

Evaluate an expression as it's received.

def proto_version(self, vnum): (source)

Protocol message: (version version-number)

Check to make sure that both ends of the protocol are speaking the same version dialect.

ParametersvnumThe version number.
def sendCall(self, *exp): (source)

Utility method to send an expression to the other side of the connection.

ParametersexpThe expression.
def proto_didNotUnderstand(self, command): (source)

Respond to stock 'didNotUnderstand' message.

Log the command that was not understood and continue. (Note: this will probably be changed to close the connection or raise an exception in the future.)

ParameterscommandThe command to log.
def connectionReady(self): (source)

Initialize. Called after Banana negotiation is done.

def connectionFailed(self): (source)

Undocumented

def connectionLost(self, reason): (source)

The connection was lost.

Parametersreasonmessage to put in failure.Failure
localSecurity = (source)

Undocumented

remoteSecurity = (source)

Undocumented

def notifyOnDisconnect(self, notifier): (source)
Parametersnotifiercallback to call when the Broker disconnects.
def notifyOnFail(self, notifier): (source)
Parametersnotifiercallback to call if the Broker fails to connect.
def notifyOnConnect(self, notifier): (source)
Parametersnotifiercallback to call when the Broker connects.
def dontNotifyOnDisconnect(self, notifier): (source)
Parametersnotifiercallback to remove from list of disconnect callbacks.
def localObjectForID(self, luid): (source)

Get a local object for a locally unique ID.

ReturnsAn object previously stored with registerReference or None if there is no object which corresponds to the given identifier.
maxBrokerRefsViolations = (source)

Undocumented

def registerReference(self, object): (source)

Store a persistent reference to a local object and map its id() to a generated, session-unique ID.

Parametersobjecta local object
Returnsthe generated ID
def setNameForLocal(self, name, object): (source)

Store a special (string) ID for this object.

This is how you specify a 'base' set of objects that the remote protocol can connect to.

ParametersnameAn ID.
objectThe object.
def remoteForName(self, name): (source)

Returns an object from the remote name mapping.

Note that this does not check the validity of the name, only creates a translucent reference for it.

ParametersnameThe name to look up.
ReturnsAn object which maps to the name.
def cachedRemotelyAs(self, instance, incref=0): (source)
ParametersinstanceThe instance to look up.
increfFlag to specify whether to increment the reference.
ReturnsAn ID that says what this instance is cached as remotely, or None if it's not.
def remotelyCachedForLUID(self, luid): (source)
ParametersluidThe LUID to look up.
ReturnsAn instance which is cached remotely.
def cacheRemotely(self, instance): (source)

XXX

ReturnsA new LUID.
def cacheLocally(self, cid, instance): (source)

(internal)

Store a non-filled-out cached instance locally.

def cachedLocallyAs(self, cid): (source)

Undocumented

def serialize(self, object, perspective=None, method=None, args=None, kw=None): (source)

Jelly an object according to the remote security rules for this broker.

ParametersobjectThe object to jelly.
perspectiveThe perspective.
methodThe method.
argsArguments.
kwKeyword arguments.
serializingPerspective = (source)

Undocumented

jellyMethod = (source)

Undocumented

jellyArgs = (source)

Undocumented

jellyKw = (source)

Undocumented

def unserialize(self, sexp, perspective=None): (source)

Unjelly an sexp according to the local security rules for this broker.

ParameterssexpThe object to unjelly.
perspectiveThe perspective.
def newLocalID(self): (source)
ReturnsA newly generated LUID.
def newRequestID(self): (source)
ReturnsA newly generated request ID.
def _sendMessage(self, prefix, perspective, objectID, message, args, kw): (source)

Undocumented

def proto_message(self, requestID, objectID, message, answerRequired, netArgs, netKw): (source)

Undocumented

def proto_cachemessage(self, requestID, objectID, message, answerRequired, netArgs, netKw): (source)

Undocumented

def _recvMessage(self, findObjMethod, requestID, objectID, message, answerRequired, netArgs, netKw): (source)

Received a message-send.

Look up message based on object, unserialize the arguments, and invoke it with args, and send an 'answer' or 'error' response.

ParametersfindObjMethodA callable which takes objectID as argument.
requestIDThe requiest ID.
objectIDThe object ID.
messageThe message.
answerRequired
netArgsArguments.
netKwKeyword arguments.
def _sendAnswer(self, netResult, requestID): (source)

(internal) Send an answer to a previously sent message.

ParametersnetResultThe answer.
requestIDThe request ID.
def proto_answer(self, requestID, netResult): (source)

(internal) Got an answer to a previously sent message.

Look up the appropriate callback and call it.

ParametersrequestIDThe request ID.
netResultThe answer.
def _sendFailureOrError(self, fail, requestID): (source)

Call _sendError or _sendFailure, depending on whether fail represents an Error subclass or not.

ParametersfailThe failure.
requestIDThe request ID.
def _sendFailure(self, fail, requestID): (source)

Log error and then send it.

ParametersfailThe failure.
requestIDThe request ID.
def _sendError(self, fail, requestID): (source)

(internal) Send an error for a previously sent message.

ParametersfailThe failure.
requestIDThe request ID.
def proto_error(self, requestID, fail): (source)

(internal) Deal with an error.

ParametersrequestIDThe request ID.
failThe failure.
def sendDecRef(self, objectID): (source)

(internal) Send a DECREF directive.

ParametersobjectIDThe object ID.
def proto_decref(self, objectID): (source)

(internal) Decrement the reference count of an object.

If the reference count is zero, it will free the reference to this object.

ParametersobjectIDThe object ID.
def decCacheRef(self, objectID): (source)

(internal) Send a DECACHE directive.

ParametersobjectIDThe object ID.
def proto_decache(self, objectID): (source)

(internal) Decrement the reference count of a cached object.

If the reference count is zero, free the reference, then send an 'uncached' directive.

ParametersobjectIDThe object ID.
def proto_uncache(self, objectID): (source)

(internal) Tell the client it is now OK to uncache an object.

ParametersobjectIDThe object ID.
API Documentation for Twisted, generated by pydoctor 20.12.1 at 2021-02-28 19:53:36.