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