note 13216 deleted from function.set-time-limit by jimw
| From: | jimw@php.net | Date: | Sat, 22 Sep 2001 09:42:43 +0000 |
| Subject: | note 13216 deleted from function.set-time-limit by jimw | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-18174@lists.php.net to get a copy of this message | ||
Response to malhavoc
You can simulate perl-esque type function like alarm(), for timeout on non-critical task by putting
the classes or function into SOAP or XML-RPC wrappers and settign set_time_limit on those functions.
When an a call is made to the object, it will timeout in accordance to the limit set on the
function/class page. The calling page can then move on to do other tasks.
Another simpler way to do it is to just put the desired code in another page, and call it from the
main page via fopen over http. When the function page is retrieved, the non-critical code is
executed with a timeout. Not as elegant, but will give the same desired result without hastle of
XML-RPC or SOAP.