Re: PHP 4.0 Bug #9273 Updated: feature request: pg_cancel()
| From: | (Wolfgang Hamann) | Date: | Mon, 19 Mar 2001 00:14:37 +0000 |
| Subject: | Re: PHP 4.0 Bug #9273 Updated: feature request: pg_cancel() | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-49311@lists.php.net to get a copy of this message | ||
Hello sasha,
actually I added pg_cancel to the postgres tcl interface in order to support async
processing. The main reason I wanted that was to keep some responsiveness of the gui
during database transactions. It turned out to be fairly easy in this case because
postgres already processes the transaction asynchronously and it is just the client
that is sitting in a loop. On the other side of the coin, there is not too much the script
can do while it is waiting for results, so async processing might be pointless if the
script does not have a gui.
Once in place, I tried pg_cancel by itself on the webserver in a tcl environment, and it
works fine as a signal handler, so when the webserver times out, it sends a SIGTERM, and
the script in turn sends a CANCEL to the database. It could probably be done in the same
way if the internal timeout (or the signal from the webserver) just calls the pg_cancel().
Can a registered shutdown function do that if the script does not try to catch the event
by itselt?
Wolfgang Hamann