class StringProducer: (source)
Implements interfaces: twisted.web.iweb.IBodyProducer
StringProducer
is a dummy body producer.
Method | __init__ |
Undocumented |
Method | pause |
Pause producing data. |
Method | resume |
Resume producing data. |
Method | start |
Start producing to the given IConsumer provider. |
Method | stop |
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. |
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.
Resume producing data.
This tells a producer to re-add itself to the main loop and produce more data for its consumer.
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. |
In addition to the standard behavior of IProducer.stopProducing
(stop producing data), make sure the Deferred
returned by startProducing is never fired.
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.