Re: Problem with psycopg2 and asyncio

From: "Frank Millman" <frank(at)chagford(dot)com>
To: <psycopg(at)postgresql(dot)org>
Subject: Re: Problem with psycopg2 and asyncio
Date: 2016-03-01 05:24:10
Message-ID: D97F59D714E849A2AC336173CE85CE99@FrankLaptop
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: psycopg

On 29/02/16 18:07, Daniele Varrazzo wrote:

>
> On Mon, Feb 29, 2016 at 2:52 PM, Frank Millman <frank(at)chagford(dot)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.
Frank

In response to

Responses

Browse psycopg by date

  From Date Subject
Next Message Daniele Varrazzo 2016-03-01 15:30:14 Re: Problem with psycopg2 and asyncio
Previous Message Frank Millman 2016-03-01 05:18:35 Re: Problem with psycopg2 and asyncio