|
notify.py: msg#00077python.db.psycopg.devel
I'm trying to refactor some of my code to use the "new" method of doing a LISTEN on the database, I'm stuck on this key piece of code: print "Waiting for 'NOTIFY test'" while 1: if select.select([curs],[],[],5)==([],[],[]): print "Timeout" else: if curs.isready(): print "Got NOTIFY: %s" % str(curs.connection.notifies.pop()) I understand the 'select' part. What does curs.isready() do? What happens if it comes back as not True? Also, I presume the '.pop()' ought to be called repeatedly until there are no more? How does one know that? Does this all replace the previous way of doing things that looked something like this? n = curs.notifies()[0][0] # Get the notification Any help/explanation appreciated. Thanks, Michael |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: query: 00077, Federico Di Gregorio |
|---|---|
| Next by Date: | Re: notify.py: 00077, Federico Di Gregorio |
| Previous by Thread: | queryi: 00077, Timothy Smith |
| Next by Thread: | Re: notify.py: 00077, Federico Di Gregorio |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |