Jerome Eteve > Apache2-REST-0.07 > Apache2::REST::WriterStream

Download:
Apache2-REST-0.07.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Source  

NAME ^

Apache2::REST::WriterStream - A base class for writing a response as a stream

METHODS ^

new

You can override this if you like but remember it has to build an object without arguments.

mimeType

Returns the mime type this writer will output.

It is called like this by the framework:

   $this->mimeType($resp) ;

So you can adapt the mime type according to the response to be given.

getPreambleBytes

Returns the bytes the framework has to write back to client as a Stream preamble.

It is called by the framework like this ($resp is a Apache2::REST::Response):

    $this->getPreambleBytes($resp) ;

getNextBytes

Returns the next bytes of the stream, or undef at the end of the stream.

Called by the framework like that:

while( defined my $bytes = $this->getNextBytes($response) ){ ... }

getPostambleBytes

Returns the last bytes to write in the stream when the stream is finished.

Called by the framework like that:

$this->getPostambleBytes($response);

handleModPerlResponse

Handles writing this response in a mod perl request object at response time.

Beware, this method switches STDOUT to binmode.

syntax highlighting: