class documentation

class StringProducer: (source)

Implements interfaces: twisted.web.iweb.IBodyProducer

View In Hierarchy

StringProducer is a dummy body producer.

Method __init__ Undocumented
Method pauseProducing Pause producing data.
Method resumeProducing Resume producing data.
Method startProducing Start producing to the given IConsumer provider.
Method stopProducing In addition to the standard behavior of IProducer.stopProducing (stop producing data), make sure the Deferred returned by startProducing is never fired.
Instance Variable consumer After startProducing is called, the value of the consumer argument to that method.
Instance Variable finished After startProducing is called, a Deferred which was returned by that method. StringProducer will never fire this Deferred.
Instance Variable length length is a int indicating how many bytes in total this IBodyProducer will write to the consumer or UNKNOWN_LENGTH if this is not known in advance.
Instance Variable stopped A flag which indicates whether or not stopProducing has been called.
def __init__(self, length): (source)

Undocumented

def pauseProducing(self): (source)

Pause producing data.

Tells a producer that it has produced too much data to process for the time being, and to stop until resumeProducing() is called.

def resumeProducing(self): (source)

Resume producing data.

This tells a producer to re-add itself to the main loop and produce more data for its consumer.

def startProducing(self, consumer): (source)

Start producing to the given IConsumer provider.

Returns
A Deferred which stops production of data when Deferred.cancel is called, and which fires with None when all bytes have been produced or with a Failure if there is any problem before all bytes have been produced.
def stopProducing(self): (source)

In addition to the standard behavior of IProducer.stopProducing (stop producing data), make sure the Deferred returned by startProducing is never fired.

consumer = (source)

After startProducing is called, the value of the consumer argument to that method.

finished = (source)

After startProducing is called, a Deferred which was returned by that method. StringProducer will never fire this Deferred.

length is a int indicating how many bytes in total this IBodyProducer will write to the consumer or UNKNOWN_LENGTH if this is not known in advance.

A flag which indicates whether or not stopProducing has been called.