| |
- ASStreamOut
- exceptions.Exception(exceptions.BaseException)
-
- ConnectionAbortedError
- InvalidCommandSequence
class ASStreamOut |
|
This is a response stream to the client.
The key attributes of this class are:
`_autoCommit`:
If True, the stream will automatically start sending data
once it has accumulated `_bufferSize` data. This means that
it will ask the response to commit itself, without developer
interaction. By default, this is set to False.
`_bufferSize`:
The size of the data buffer. This is only used when autocommit
is True. If not using autocommit, the whole response is
buffered and sent in one shot when the servlet is done.
`flush()`:
Send the accumulated response data now. Will ask the `Response`
to commit if it hasn't already done so. |
|
Methods defined here:
- __init__(self, autoCommit=False, bufferSize=8192)
- autoCommit(self)
- Get the auto commit mode.
- buffer(self)
- Return accumulated data which has not yet been flushed.
We want to be able to get at this data without having to call flush
first, so that we can (for example) integrate automatic HTML validation.
- bufferSize(self)
- Get the buffer size.
- clear(self)
- Try to clear any accumulated response data.
Will fail if the response is already sommitted.
- close(self)
- Close this buffer. No more data may be sent.
- closed(self)
- Check whether we are closed to new data.
- commit(self, autoCommit=True)
- Called by the Response to tell us to go.
If `_autoCommit` is True, then we will be placed into autoCommit mode.
- committed(self)
- Are we committed?
- flush(self)
- Flush stream.
Send available data as soon as possible, i.e. *now*.
Returns True if we are ready to send, otherwise False (i.e.,
if the buffer is full enough).
- needCommit(self)
- Request for commitment.
Called by the `HTTPResponse` instance that is using this instance
to ask if the response needs to be prepared to be delivered.
The response should then commit it's headers, etc.
- pop(self, count)
- Remove count bytes from the front of the buffer.
- prepend(self, charstr)
- Add the attached string to front of the response buffer.
Invalid if we are already committed.
- setAutoCommit(self, autoCommit=True)
- Set the auto commit mode.
- setBufferSize(self, bufferSize=8192)
- Set the buffer size.
- size(self)
- Return the current size of the data held here.
- write(self, charstr)
- Write a string to the buffer.
|
|