Req #44348 [Fbk->NoF]: Wait for Postgres notifications
| From: | php-bugs at lists dot php dot net | Date: | Sun, 15 Aug 2021 04:22:07 +0000 |
| Subject: | Req #44348 [Fbk->NoF]: Wait for Postgres notifications | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-235819@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=44348&edit=1
ID: 44348
Updated by: php-bugs@lists.php.net
Reported by: p_ christ at hol dot gr
Summary: Wait for Postgres notifications
-Status: Feedback
+Status: No Feedback
Type: Feature/Change Request
Package: PostgreSQL related
Operating System: Linux
PHP Version: 5.2.5
Assigned To: cmb
Private report: N
New Comment:
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
Previous Comments:
------------------------------------------------------------------------
[2021-08-05 11:31:15] cmb@php.net
Would async pgsql connections and non-blocking queries[1]
(available as of PHP 5.6.0) resolve this request?
[1] <https://github.com/php/php-src/pull/626>
------------------------------------------------------------------------
[2008-03-06 00:35:11] p_christ at hol dot gr
/* {{{ proto array pg_wait_notify([resource connection[, timeout]])
Wait for postgres activity */
PHP_FUNCTION(pg_wait_notify)
{
zval *pgsql_link;
int id = -1;
int retval = 0;
int timeout = -1;
struct pollfd ps;
PGconn *pgsql;
if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "r|l",
&pgsql_link, &timeout) == FAILURE) {
RETURN_FALSE;
}
ZEND_FETCH_RESOURCE2(pgsql, PGconn *, &pgsql_link, id, "PostgreSQL link", le_link,
le_plink);
ps.fd = PQsocket(pgsql);
ps.events = POLLIN;
ps.revents = 0;
if (ps.fd<0)
RETURN_FALSE;
retval = poll(&ps,1,timeout);
if (retval == -1) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "unable to poll : %d", errno);
RETURN_FALSE;
}
RETURN_LONG(retval);
}
/* }}} */
------------------------------------------------------------------------
[2008-03-06 00:32:52] p_ christ at hol dot gr
Description:
------------
Add one more internal PHP function that will C-poll() the Postgres file descriptor for async events.
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=44348&edit=1