> On Mon, Feb 29, 2016 at 2:52 PM, Frank Millman <frank@chagford.com> wrote: > > > Of course I may just be doing something silly, in which case I would be > > delighted if someone pointed it out. > > Are you running psycopg in async mode or in green mode? >
To be honest, I don’t know what that means, so I am probably running in green mode.
I am aware that psycopg2 has some extensions that enable asynchronous communication, but I am not using any of those.
To repeat what I replied to Michael,
I still think that my theory holds water. Run the database in its own thread, pass requests to it using a queue.Queue(), and pass results back using an asyncio.Queue(). It works brilliantly for the other two databases, and I cannot see any reason why it should not work with psycopg2.