Implements interfaces: twisted.internet.interfaces.IConsumer

A task which adds a message to a maildir mailbox.

Instance Variable mbox See __init__.
Instance Variable defer A deferred which fires when the task has completed. (type: Deferred which successfully returns None)
Instance Variable opencall A scheduled call to prodProducer. (type: IDelayedCall provider or None)
Instance Variable msg The message to add. (type: file-like object)
Instance Variable tmpname The pathname of the temporary file holding the message while it is being transferred. (type: bytes)
Instance Variable fh The new maildir file. (type: file)
Instance Variable filesender A file sender which sends the message. (type: FileSender)
Instance Variable myproducer The registered producer. (type: IProducer)
Instance Variable streaming Indicates whether the registered producer provides a streaming interface. (type: bool)
Method __init__
Method startUp Start transferring the message to the mailbox.
Method registerProducer Register a producer and start asking it for data if it is non-streaming.
Method prodProducer Repeatedly prod a non-streaming producer to produce data.
Method unregisterProducer Finish transferring the message to the mailbox.
Method write Write data to the maildir file.
Method fail Fire the deferred to indicate the task completed with a failure.
Method moveFileToNew Place the message in the new/ directory, add it to the mailbox and fire the deferred to indicate that the task has completed successfully.
Method createTempFile Create a temporary file to hold the message as it is being transferred.
mbox =
See __init__.
defer =
A deferred which fires when the task has completed. (type: Deferred which successfully returns None)
opencall =
A scheduled call to prodProducer. (type: IDelayedCall provider or None)
msg =
The message to add. (type: file-like object)
tmpname =
The pathname of the temporary file holding the message while it is being transferred. (type: bytes)
fh =
The new maildir file. (type: file)
filesender =
A file sender which sends the message. (type: FileSender)
myproducer =
The registered producer. (type: IProducer)
streaming =
Indicates whether the registered producer provides a streaming interface. (type: bool)
def __init__(self, mbox, msg): (source)
ParametersmboxA maildir mailbox. (type: MaildirMailbox)
msgThe message to add. (type: bytes or file-like object)
def startUp(self): (source)

Start transferring the message to the mailbox.

def registerProducer(self, producer, streaming): (source)

Register a producer and start asking it for data if it is non-streaming.

ParametersproducerA producer. (type: IProducer)
streamingA flag indicating whether the producer provides a streaming interface. (type: bool)
def prodProducer(self): (source)

Repeatedly prod a non-streaming producer to produce data.

def unregisterProducer(self): (source)

Finish transferring the message to the mailbox.

def write(self, data): (source)

Write data to the maildir file.

ParametersdataData to be written to the file. (type: bytes)
def fail(self, err=None): (source)

Fire the deferred to indicate the task completed with a failure.

ParameterserrThe error that occurred. (type: Failure)
def moveFileToNew(self): (source)

Place the message in the new/ directory, add it to the mailbox and fire the deferred to indicate that the task has completed successfully.

def createTempFile(self): (source)

Create a temporary file to hold the message as it is being transferred.

API Documentation for Twisted, generated by pydoctor at 2017-09-23 19:45:03.