Attached is a patch that adds Postmodern support for asynchronous notifications, as documented here:
http://www.postgresql.org/docs/current/static/sql-listen.html
http://www.postgresql.org/docs/current/static/sql-notify.html
http://www.postgresql.org/docs/current/static/sql-unlisten.html
and
http://www.postgresql.org/docs/current/interactive/protocol-message-formats.... (under "NotificationResponse")
It updates MESSAGE-CASE to watch for async notifications and, by default, issue a warning that looks very similar to what the psql client displays for async notifications:
WARNING: Asynchornous notification "lisp" received from server process with PID 22063.
It also adds a blocking function, WAIT-FOR-NOTIFICATION, that adds a handler-bind around the warning and returns the notification data when a notification is received.
The patch isn't complete, though -- I wasn't sure how best to integrate the new public function, condition, and condition accessors into the documentation. How should I proceed?
Zach
Hi Zach,
The patch looks great. Do I understand correctly that one uses the SQL commands to actually enable listening or send something?
As for where the docs go, I'd say somewhere near the bottom of cl-postgresl.html, with a short mention and a link somewhere in postmodern.html. If you write out a rough draft and submit a patch containing that, I'll be happy to polish up the HTML and such.
Cheers, Marijn
postmodern-devel@common-lisp.net