example of use of psycopg's async api
Manlio Perillo <[email protected]>
| Newsgroups | gmane.comp.python.db.psycopg.devel |
|---|---|
| Message-ID | <[email protected]> |
Hi.
For people interested, I'm testing the asynchronous API of psycopg2.
The example can be found here:
http://hg.mperillo.ath.cx/nginx/mod_wsgi/file/tip/examples/nginx-postgres-async.py
It is a WSGI application executed by my WSGI module for Nginx, using a
WSGI extension for asynchronous applications support (ngx.poll).
The example is very simple, it uses a connection pool that can grow
indefinitely.
Some notes:
1) the documentation of the async API contains some errors.
I will try to write a patch (unfortunately now the web site is not
accessible).
2) psycopg2 only supports asynchronous reading of a query result?
libpq offers asynchronous support for connection establishing and
for sending a query (useful for large COPY operations)
Manlio Perillo