[Catalyst] Problem with RenderView

Wade.Stuart at fallon.com Wade.Stuart at fallon.com
Fri May 4 16:25:59 GMT 2007






Bernhard Graf <catalyst2 at augensalat.de> wrote on 05/04/2007 10:04:30 AM:

> On Friday 04 May 2007 16:41, Wade.Stuart at fallon.com wrote:
>
> > why write()?  I thought Cat does this behind the scenes if you pass
> > $c->res->body($fh); #filehandle
>
> There is no filehandle I could easily pass to $c->res->body(), because
> data comes from a DBIC ResultSet object.

I must be misreading your question then,  I read that you store large
output on disc (I assumed files?) and that you want to write this data out
in an efficient manor.  Are you saying that the actual large blobs are
stored in the database or does the database store locations to these files?
If the former, what actual gain do you get by write() instead of setting
body to a ref (you are already loading the data into memory)?  If the
latter what is wrong with creating a IO fh for the file location and
passing to body?


>
> Of course I could store the whole output from the database into an
> IO::String or similar and pass this object to $c->res->body(), but this
> buys me exactly nothing in terms of memory usage and time.
>
> I thought of doing it with fork() and IO::Pipe (let the child read from
> DBIC ResultSet and pipe() to parent), but I'm unsure about the "costs"
> and side-effects when forking from a web-server process.
> --
> Bernhard Graf
>
> _______________________________________________
> List: Catalyst at lists.rawmode.org
> Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
> Searchable archive:
http://www.mail-archive.com/catalyst@lists.rawmode.org/
> Dev site: http://dev.catalyst.perl.org/




More information about the Catalyst mailing list