[Web-SIG] [Python-Dev] wsgi validator with asynchronous handlers/servers

Manlio Perillo manlio_perillo at libero.it
Mon Mar 25 22:50:17 CET 2013


Il 24/03/2013 06:14, PJ Eby ha scritto:
> [...]
>> Thanks for response PJ,
>> that is what I, unfortunately, didn't want to hear, the validator being
>> correct for the "spec" means I can't use it for my asynchronous stuff, which
>> is a shame :-(((
>> But why commit to send headers when you may not know about your response?
>> Sorry if this is the wrong mailing list for the issue, I'll adjust as I go
>> along.
> 
> Because async was added as an afterthought to WSGI about nine years
> ago, and we didn't get it right, but it long ago was too late to do
> anything about it.  A properly async WSGI implementation will probably
> have to wait for Tulip (Guido's project to bring a standard async
> programming API to Python).

Do you really need a standard async programming API to design and
implement an async WSGI specification?

I think it is not needed.
Some time ago I posted a sample implementation and documentation for a
very simple async extension for WSGI:
https://bitbucket.org/mperillo/txwsgi

An interesting example about how an async API can be designed is
PostgreSQL libpq, where the API expose a direct interface to the
protocol state machine (pqConsumeInput), so you can not only use it with
any async framework you like, but you can also use it in blocking mode.

This, as far as I know, is impossible with the network protocol
implementations in Twisted or other async frameworks.



Regards   Manlio


More information about the Web-SIG mailing list