Apache2::REST::Stream


Apache2-REST documentation Contained in the Apache2-REST distribution.

Index


Code Index:

new

Returns a new empty instance.

nextChunk

Returns the nextChunk of data to output to the client.

This may return:

 - A reference on a chunk of data (a hash, an array, etc..)

 - A string of bytes. This is usefull when you force using
   a binary writer (by using $req->requestedFormat('bin') in your handler)

 - undef if the end of the stream is reached.

Implement this in application specific subclasses (Or use one of the provided subclasses if your data source is compatible)


Apache2-REST documentation Contained in the Apache2-REST distribution.
package Apache2::REST::Stream;
use strict;

sub new{
    my ($class) = @_;
    return bless {} , $class;
}

sub nextChunk{
    my ($self) = @_;
    confess("Please implement me in an application specific subclass");
}

1;