Re: pcntl_fork and classes

From: Date: Tue, 29 Jun 2004 01:30:49 +0000
Subject: Re: pcntl_fork and classes
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-189206@lists.php.net to get a copy of this message
Hello, On 06/27/2004 05:31 PM, josh@warofthemagi.net wrote:
Is it possible to pcntl_fork() withing a class? Basically I want a web page to load, and when the class is called in the page, it can fork and the child can run, allowing the webpage to finish, but the class process can continue 'till it's done. Is this possible? Would I put the fork in the constructor? Would calling the class methods after it forked work the same way?
You can fork processes from anywhere in your scripts including from classes as you may see in this class. I just doubt that you the forked processes outlive the current request. Class: Thread http://www.phpclasses.org/php_fork -- Regards, Manuel Lemos PHP Classes - Free ready to use OOP components written in PHP http://www.phpclasses.org/ PHP Reviews - Reviews of PHP books and other products http://www.phpclasses.org/reviews/ Metastorage - Data object relational mapping layer generator http://www.meta-language.net/metastorage.html

« previous php.general (#189206) next »