note 125453 added to function.pg-get-notify
| From: | david at frankieandshadow dot com | Date: | Thu, 22 Oct 2020 13:52:28 +0000 |
| Subject: | note 125453 added to function.pg-get-notify | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-215630@lists.php.net to get a copy of this message | ||
It appears that pg_get_notify does not distinguish between no message waiting and a failure when
checking - both seem to return FALSE.
I had to add a pg_check_connection(...) before pg_get_notify to check the connection is still alive
(it's quite likely to be a long-standing connection with pg_get_notify as you'll be
polling waiting for something to happen). In my case the remote database server had a hiccup, and
without pg_check_connection the listeners failed to notice, so never saw later notifications.
----
Server IP: 45.112.84.4
Probable Submitter: 185.85.3.174 (proxied: 217.146.29.68)
----
Manual Page -- http://php.net/manual/en/function.pg-get-notify.php
Edit -- https://master.php.net/note/edit/125453
Del: integrated -- https://master.php.net/note/delete/125453/integrated
Del: useless -- https://master.php.net/note/delete/125453/useless
Del: bad code -- https://master.php.net/note/delete/125453/bad+code
Del: spam -- https://master.php.net/note/delete/125453/spam
Del: non-english -- https://master.php.net/note/delete/125453/non-english
Del: in docs -- https://master.php.net/note/delete/125453/in+docs
Del: other reasons-- https://master.php.net/note/delete/125453
Reject -- https://master.php.net/note/reject/125453
Search -- https://master.php.net/manage/user-notes.php