t.w._.LengthEnforcingConsumer : class documentation

Part of twisted.web._newclient View Source View In Hierarchy

An IConsumer proxy which enforces an exact length requirement on the total data written to it.
Instance Variables_lengthThe number of bytes remaining to be written.
_producerThe IBodyProducer which is writing to this consumer.
_consumerThe consumer to which at most _length bytes will be forwarded.
_finishedA Deferred which will be fired with a Failure if too many bytes are written to this consumer.
Method __init__ Undocumented
Method write Write bytes to the underlying consumer unless _noMoreWritesExpected has been called or there are/have been too many bytes.
Method _allowNoMoreWrites Indicate that no additional writes are allowed. Attempts to write after calling this method will be met with an exception.
Method _noMoreWritesExpected Called to indicate no more bytes will be written to this consumer. Check to see that the correct number have been written.
def __init__(self, producer, consumer, finished): (source)
Undocumented
def _allowNoMoreWrites(self): (source)
Indicate that no additional writes are allowed. Attempts to write after calling this method will be met with an exception.
def write(self, bytes): (source)
Write bytes to the underlying consumer unless _noMoreWritesExpected has been called or there are/have been too many bytes.
def _noMoreWritesExpected(self): (source)
Called to indicate no more bytes will be written to this consumer. Check to see that the correct number have been written.
RaisesWrongBodyLengthIf not enough bytes have been written.
API Documentation for Twisted, generated by pydoctor at 2011-10-27 16:27:37.