class documentation

class MessageWrapper: (source)

Implements interfaces: twisted.mail.interfaces.IMessageSMTP

View In Hierarchy

A message receiver which delivers a message to a child process.
Method __init__
Method __str__ Build a string representation of this MessageWrapper instance.
Method connection​Lost Ignore notification of lost connection.
Method eom​Received Disconnect from the child process and set up a timeout to wait for it to exit.
Method line​Received Write a received line to the child process.
Instance Variable completion The deferred which will be triggered by the protocol when the child process exits.
Instance Variable completion​Timeout The number of seconds to wait for the child process to exit before reporting the delivery as a failure.
Instance Variable done A flag indicating whether the child process has exited (True) or not (False).
Instance Variable process​Name The process name.
Instance Variable protocol See __init__.
Instance Variable reactor A reactor which will be used to schedule timeouts.
Method _completion​Cancel Handle the expiration of the timeout for the child process to exit by terminating the child process forcefully and issuing a failure to the completion deferred.
Method _process​Ended Record process termination and cancel the timeout call if it is active.
Instance Variable _timeout​Call​ID The call used to time out delivery, started when the connection to the child process is closed.
def __init__(self, protocol, process=None, reactor=None): (source)
Parameters
protocol:ProcessAliasProtocolThe protocol associated with the child process.
process:bytes or NoneThe process name.
reactor:None or IReactorTime providerA reactor which will be used to schedule timeouts.
def __str__(self): (source)
Build a string representation of this MessageWrapper instance.
Returns
bytesA string containing the name of the process.
def connectionLost(self): (source)
Ignore notification of lost connection.
def eomReceived(self): (source)
Disconnect from the child process and set up a timeout to wait for it to exit.
Returns
DeferredA deferred which will be called back when the child process exits.
def lineReceived(self, line): (source)
Write a received line to the child process.
Parameters
line:bytesA received line of the message.
completion: Deferred = (source)
The deferred which will be triggered by the protocol when the child process exits.
completionTimeout: int or float = (source)
The number of seconds to wait for the child process to exit before reporting the delivery as a failure.
A flag indicating whether the child process has exited (True) or not (False).
processName: bytes or None = (source)
The process name.
protocol = (source)
See __init__.
reactor: IReactorTime provider = (source)
A reactor which will be used to schedule timeouts.
def _completionCancel(self): (source)
Handle the expiration of the timeout for the child process to exit by terminating the child process forcefully and issuing a failure to the completion deferred.
def _processEnded(self, result): (source)
Record process termination and cancel the timeout call if it is active.
Parameters
result:FailureThe reason the child process terminated.
Returns
None or FailureNone, if the process end is expected, or the reason the child process terminated, if the process end is unexpected.
_timeoutCallID: None or IDelayedCall provider = (source)
The call used to time out delivery, started when the connection to the child process is closed.