william at 25thandClement dot com said: "There is no way to poll/wait for a notification to come in. .."
Yes, there is. If there is a query in progress, pg_get_result() will block and return the result of that query when it's complete.
(PHP 4 >= 4.2.0, PHP 5)
pg_get_result — 取得异步查询结果
add a note User Contributed Notes pg_get_result - [2 notes]
Marko Tiikkaja ¶
4 years ago
william at 25thandClement dot com ¶
8 years ago
There is no way to poll/wait for a notification to come in. You either have to enter a busy loop or sleep. Both options are horrible. It would be nice for PHP to provide access to PQsocket so one could select() on the socket connection. This is how it's done from C or Perl.