Re: NOTIFY in asynchronous mode

Поиск
Список
Период
Сортировка
От Daniele Varrazzo
Тема Re: NOTIFY in asynchronous mode
Дата
Msg-id CA+mi_8Y0VHPNQtApjWjEkkDzqUYiL6a=J-w35uavtOy528h8zQ@mail.gmail.com
обсуждение исходный текст
Ответ на NOTIFY in asynchronous mode  (Tobias Oberstein <tobias.oberstein@tavendo.de>)
Список psycopg
On Sat, Nov 5, 2011 at 12:03 AM, Jan Urbański <wulczer@wulczer.org> wrote:
> On 04/11/11 21:23, Daniele Varrazzo wrote:
>> On Fri, Nov 4, 2011 at 7:12 PM, Tobias Oberstein
>> <tobias.oberstein@tavendo.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

В списке psycopg по дате отправления:

Предыдущее
От: Jan Urbański
Дата:
Сообщение: Re: NOTIFY in asynchronous mode
Следующее
От: Jan Urbański
Дата:
Сообщение: Re: NOTIFY in asynchronous mode