[Web-SIG] WSGI async API

Carlos Ribeiro carribeiro at gmail.com
Fri Oct 15 19:51:54 CEST 2004


On Fri, 15 Oct 2004 13:24:19 -0400, Peter Hunt <floydophone at gmail.com> wrote:
> Essentially, Twisted.Web gives you something like this:
> 
> class MyResource(resource.Resource):
>     def render(self, request):
>         return "content here" # you could also do request.write("content here")
> 
> If you do an async call, you have to use request.write() to write the
> data, return server.NOT_DONE_YET from the render() method, and call
> request.finish() to finish the request.

Just curious, so forgive me from jumping into the middle of the
discussion. Isn't this one of the scenarios where output generators
are most useful? Assuming that Twisted supported it, you could yield
lines until there were nothing else to write. Did I get it right?


-- 
Carlos Ribeiro
Consultoria em Projetos
blog: http://rascunhosrotos.blogspot.com
blog: http://pythonnotes.blogspot.com
mail: carribeiro at gmail.com
mail: carribeiro at yahoo.com


More information about the Web-SIG mailing list