Re: python async with psycopg2

Поиск
Список
Период
Сортировка
От Daniele Varrazzo
Тема Re: python async with psycopg2
Дата
Msg-id CA+mi_8ZwUmSR37y3pSZA733=LDvm386Jh3O7x9BD=i+9enSdfg@mail.gmail.com
обсуждение исходный текст
Ответ на python async with psycopg2  (Rita <rmorgan466@gmail.com>)
Список pgsql-general
On Fri, 17 Jul 2020 at 20:44, Rita <rmorgan466@gmail.com> wrote:>

>     curs = conn.cursor()
>     curs.execute("LISTEN mychan0;")
>     #curs.execute("LISTEN mychan1;") #fails!
>     wait_select(conn)

Maybe you have to wait_select after each execute.

This example could be helpful.
https://www.psycopg.org/docs/advanced.html#asynchronous-notifications
Note that you don't need an async connection to receive notification:
a sync one, as long as is in autocommit and you are using an I/O
completion function to wait for readiness, works as well.

-- Daniele



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

Предыдущее
От: Rita
Дата:
Сообщение: python async with psycopg2
Следующее
От: Adrian Klaver
Дата:
Сообщение: Re: About compress in pg_dump