[Web-SIG] WSGI and start_response
manlio_perillo at libero.it
Thu Apr 8 16:08:26 CEST 2010
Some time ago I objected the decision to remove start_response function
from next version WSGI, using as rationale the fact that without
start_callable, asynchronous extension are impossible to support.
Now I have found that removing start_response will also make impossible
to support coroutines (or, at least, some coroutines usage).
Here is an example (this is the same example I posted few days ago):
Forgetting about the write callable, the problem is that the application
starts to yield data when tmpl.render_unicode function is called.
Please note that this has *nothing* to do with asynchronus applications.
The code should work with *all* WSGI implementations.
In the pasted example, the Mako render_unicode function is "turned" into
a generator, with a simple function that allows to flush the current buffer.
Can someone else confirm that this code is impossible to support in WSGI
If my suspect is true, I once again object against removing start_response.
WSGI 1.0 is really a well designed protocol, since it is able to support
both asynchonous application (with a custom extension) and coroutines,
*even* if this was not considered during protocol design.
More information about the Web-SIG