note 37638 added to function.register-shutdown-function
| From: | gabe at websaviour dot com | Date: | Fri, 21 Nov 2003 17:09:48 +0000 |
| Subject: | note 37638 added to function.register-shutdown-function | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-60759@lists.php.net to get a copy of this message | ||
It should be noted that register_shutdown_function() does not guarantee that the connection will be
closed before executing the function. In particular on Apache 1.3.27 w/ PHP 4.3.0 on OS X as well
as Apache 1.3.22 w/ PHP 4.1.2 on Red Hat I have discovered that Apache does not close the connection
until after the registered shutdown function has completed execution. I am not sure what the
circumstances that cause this are, but there is a bug at http://bugs.php.net/bug.php?id=20447
This is important, because as far as I can tell, the documented functionality of
register_shutdown_function() is the *ONLY* way to achieve anything resembling asynchronous
processing with PHP in a web server environment. In my mind this is a severe limitation, because if
you have some processing intensive task that needs to be done and you want to do it in PHP, there is
no way to have it occur without an accompanying wait in a browser window. Sure you can use
ignore_user_abort() to ensure that processing doesn't get cancelled by an impatient user (or
impatient browser for that matter), but usability is still compromised.
----
Manual Page -- http://www.php.net/manual/en/function.register-shutdown-function.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+37638
Delete -- http://master.php.net/manage/user-notes.php?action=delete+37638&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+37638&report=yes
Search -- http://master.php.net/manage/user-notes.php