This project is archived and is in readonly mode.
Support notifications payload
-
Kevin
Is there a way I can download this? The link for that branch is broken.
-
Daniele Varrazzo
Uhm, gitweb doesn't parse the %3B back into semicolons :\ Try http://tinyurl.com/35nckh5
The branch has been rebased into my python2 branch that you can access from http://tinyurl.com/piro-psycopg2
git url is <git://src.develer.com/users/piro/psycopg2.git> To summarize, currently you can find the feature both in the 'python2' and the 'notify-payload' branches.
-
Daniele Varrazzo
We have just released 2.3.0-beta1: the version includes this feature.
-
Kevin
Cool, sorry for the dumb question, it may not go here, but:
while conn.notifies: print type(conn.notifies) noti = conn.notifies.pop() print "Got NOTIFY:", noti if noti[1] == "questions_audiogen": print "Yep ", noti[2][root@vps python]# ./psycopg-listen.py
Got NOTIFY: Notify(11913, 'questions_audiogen', '3')
Yep
Traceback (most recent call last):
File "./psycopg-listen.py", line 24, in ?print "Yep ", noti[2]IndexError: index out of range
But I can print [0] and [1] OK: Yep 11913 questions_audiogen
Why's this?
Also, are you guys on IRC anywhere?
Thanks for your help.
-
Daniele Varrazzo
Hi,
the example in the notify section is actually misleading. pid and channel are only accessed as [0] and [1] for backward compatibility. Take a look at the Notify doc: you can access the notify details by attributes
.pid,.channel,.payload.I will fix the example to make this obvious. Thank you for testing!
Sorry, no IRC for the moment...
-
Daniele Varrazzo
- State changed from open to resolved