> It's supposed to stream the response if you set response.stream: True. > However, there is some question whether this is working properly: > > http://www.cherrypy.org/ticket/696 > > From what I can tell though, it should be streaming the response since > serve_file() returns a file object, which the wsgi server then calls > encode() on. Encode then sees that response.stream is True, and begins > yielding the body in chunks.
If I read ticket 696 correctly, serve_file() will stream if response.stream is set to true, but buffer otherwise. The problem is that the submitter assumed, as did I, that if you used serve_file() cherrypy would figure out how to get the data to the user, picking the appropriate strategy itself. The ReturnVsYield documentation seems to imply that one only needs to consider this when you the developer write code that yields. I find that a bit misleading. Regardless, I think we finally have an answer to my question: it's a workaround for memory exhaustion problems in any situation where the depot serves large files using serve_file(). -j _______________________________________________ pkg-discuss mailing list [email protected] http://mail.opensolaris.org/mailman/listinfo/pkg-discuss
