ZendX_Console_Process_Unix allows you to spawn a class as a separated process
Located in /Console/Process/Unix.php (line 31)
Constructor method
Allocates a new pseudo-thread object. Optionally, set a PUID, a GUID and a UMASK for the child process. This also initialize Shared Memory Segments for process communications.
Stop the child on destruction
Read the time elapsed since the last child setAlive() call.
This method is useful because often we have a pseudo-thread pool and we need to know each pseudo-thread status. If the child executes the setAlive() method, the parent with getLastAlive() can know that child is alive.
Returns the PID of the current pseudo-thread.
Get a variable from the shared memory segment. Returns NULL if the variable doesn't exist.
Test if the pseudo-thread is already started.
Set a variable into the shared memory segment, so that it can accessed both from the parent and from the child process. Variable names beginning with underlines are only permitted to interal functions.
Causes this pseudo-thread to begin parallel execution.
This method first checks of all the Shared Memory Segment. If okay, it forks the child process, attaches signal handler and returns immediatly. The status is set to running, and a PID is assigned. The result is that two pseudo-threads are running concurrently: the current thread (which returns from the call to the start() method) and the other thread (which executes its run() method).
Causes the current thread to die.
The relative process is killed and disappears immediately from the processes list.
This is called from within the parent; all the communication stuff is done here.
This method actually implements the pseudo-thread logic.
Set a pseudo-thread property that can be read from parent process in order to know the child activity.
Practical usage requires that child process calls this method at regular time intervals; parent will use the getLastAlive() method to know the elapsed time since the last pseudo-thread life signals...
Documentation generated on Mon, 29 Nov 2010 23:52:49 +0300 by phpDocumentor 1.4.2