This project is archived and is in readonly mode.
Missing cursor.isready and cursor.fileno in 2.3.0
-
Daniele Varrazzo
- State changed from new to invalid
Hello,
isready()was dropped in the async overhaul performed in psycopg 2.2 release.fileno()was moved from the cursor to the connection, as it is the connection to wrap the socket. You can access it usingcur.connection.fileno().Listening for notify whould be easier than it was before 2.2: use
connection.poll()and check if there is anything new innotifies. More efficient than continuous polling, you can useconn.fileno()in a wait facility such asselect()and only poll when there is something to read. There is no more need forisready():poll()cares about it. The doc contains examples about how to use the interface.It should be easy to adapt the code to the new interface. If it proves hard, please send a snippet with your previous listening loop and we may be able to help you (see the lighthouse help if you want to post code well formatted).