Re: NOTIFY in asynchronous mode

From: Daniele Varrazzo <daniele(dot)varrazzo(at)gmail(dot)com>
To: Jan Urbański <wulczer(at)wulczer(dot)org>
Cc: Tobias Oberstein <tobias(dot)oberstein(at)tavendo(dot)de>, "psycopg(at)postgresql(dot)org" <psycopg(at)postgresql(dot)org>
Subject: Re: NOTIFY in asynchronous mode
Date: 2011-11-05 00:15:30
Message-ID: CA+mi_8Y0VHPNQtApjWjEkkDzqUYiL6a=J-w35uavtOy528h8zQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: psycopg

On Sat, Nov 5, 2011 at 12:03 AM, Jan Urbański <wulczer(at)wulczer(dot)org> wrote:
> On 04/11/11 21:23, Daniele Varrazzo wrote:
>> On Fri, Nov 4, 2011 at 7:12 PM, Tobias Oberstein
>> <tobias(dot)oberstein(at)tavendo(dot)de> wrote:
>>
>>> is it possible to use notification (sent via NOTIFY from Postgres) in asynchronous mode?
>>
>> Yes: you should register the connection's file descriptor in the
>> twisted reactor so that you can be notified by the kernel when the
>> server sends you a notification.
>
> Actually... it won't work out of the box. I got a patch from someone
> that added NOTIFY support for txpostgres, but it broke some unit tests
> and there were a few other minor issues with it and then I kind of
> forgot about it.

Is it possible to use a naked psycopg connection instead of tx? I
mean, not for the regular query-return cycle, but just for sitting
idle in the reactor and get a callback called upon notify.

-- Daniele

In response to

Responses

Browse psycopg by date

  From Date Subject
Next Message Jan Urbański 2011-11-05 00:21:34 Re: NOTIFY in asynchronous mode
Previous Message Jan Urbański 2011-11-05 00:03:53 Re: NOTIFY in asynchronous mode