On Tuesday, 29 April 2014 10:35:51 UTC-7, Jonathan Vanasco wrote:
>
>    - if you generate a large document... we tabled it.  it'll need to be 
> revisited in the future.  the problem was with memory and computer 
> performance.  you need to use "stream=True" on requests to iterate the 
> backend response into a tempfile, then have pyramid deliver that... but we 
> couldn't find a sweet spot on the tempfile/chunking settings or on getting 
> it out of pyramid. 
>

Rather than writing to a tempfile, you could try passing the chunks on to 
the client directly. I think something like this should work:

    r = requests.get(url, stream=True)
    return Response(status_code=r.status_code, app_iter=r.iter_content())

You'll want to configure your server with many threads or use gevent for a 
site doing this.

Laurence


-- 
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/pylons-discuss.
For more options, visit https://groups.google.com/d/optout.

Reply via email to