[Web-SIG] ngx.poll extension (was Re: Are you going to convert Pylons code into Python 3000?)
Manlio Perillo
manlio_perillo at libero.it
Fri Mar 7 10:54:48 CET 2008
Graham Dumpleton ha scritto:
> [...]
>
> In part adding to what Brian is saying, you (Manlio) speak as if WSGI
> 2.0 is already somehow set in stone
Well, Philip J. Eby explicitly said that WSGI 2.0 exists only for
removing the use of start_response...
So I assume that it is already set in stone.
> and because you can't do what you
> want, then it is no good and we should keep the WSGI 1.0 way of doing
> things.
>
> Like Brian is starting to think about what else WSGI 2.0 could be so
> as to allow other ways of doing things, why don't you try the same
> thing and think about how you could do what you want in a similar
> style to WSGI 2.0, but adapting the WSGI 2.0 interface in some way. If
> the changes make sense and don't deviate too far from where we have
> been going, maybe people might accept it.
>
I have tried to figure out how to implement an asynchronous application
with WSGI 2.0, but the results are not good:
def application(environ, start_response):
def app_iter()
c = Connection(...)
r = c.request(...)
for block in r:
yield block
data = r.get_response()
environ['start_response'](
'200 OK', [('Content-Type', ('text/plain')])
yield data
return '', [], app_iter
> [...]
Manlio Perillo
More information about the Web-SIG
mailing list