t.w.s.CompoundStream(object) : class documentation

Part of twisted.web2.stream View Source View In Hierarchy

Implements interfaces: twisted.web2.stream.IByteStream, twisted.web2.stream.ISendfileableStream

A stream which is composed of many other streams.

Call addStream to add substreams.
Method __init__ Undocumented
Method addStream Add a stream to the output
Method read Read some data.
Method split Split this stream into two, at byte position 'point'.
Method close Prematurely close this stream. Should also cause further reads to return None. Additionally, .length should be set to 0.
Method _gotFailure Undocumented
Method _gotRead Undocumented
def __init__(self, buckets=()): (source)
Undocumented
def addStream(self, bucket): (source)
Add a stream to the output
def read(self, sendfile=False): (source)

Read some data.

Returns an object conforming to the buffer interface, or if there is no more data available, returns None. Can also return a Deferred resulting in one of the above.

Errors may be indicated by exception or by a Deferred of a Failure.
def _gotFailure(self, f): (source)
Undocumented
def _gotRead(self, result, sendfile): (source)
Undocumented
def split(self, point): (source)

Split this stream into two, at byte position 'point'.

Returns a tuple of (before, after). After calling split, no other methods should be called on this stream. Doing so will have undefined behavior.

If you cannot implement split easily, you may implement it as:
   return fallbackSplit(self, point)
def close(self): (source)
Prematurely close this stream. Should also cause further reads to return None. Additionally, .length should be set to 0.
API Documentation for Twisted, generated by pydoctor at 2011-10-27 16:17:34.