In re: improving async support in psycopg
Alexander Sabourenkov <[email protected]> Wed, 31 Mar 2010 14:07:01 +0400
| Newsgroups | gmane.comp.python.db.psycopg.devel |
|---|---|
| Message-ID | <[email protected]> |
Hello. I have already done a similar work, though much more invasive and resulting in what amounts to a fork of psycopg2. Most code changes were in pqpath.c. Although my coroutine/event-loop library is quite different from the gevent, general principles are same and I hope one can find some insights on how it's done. http://code.google.com/p/coev/source/browse/python-psycoev/psycoev/pqpath.c http://code.google.com/p/coev/source/browse/python-psycoev/pqpath-doc.txt Also see the interesting case of closing a connection what has been garbage-collected on interpeter exit, when the event loop has already stopped - pq_close() at pqpath.c:710 Btw, this coev framework runs pylons/django apps without code modifications apart from some module name substitution. -- ./lxnt