PowerProcess is an abstraction class for PHP's posix and pcntl extensions.
It enables easy process forking or threading to allow use of parallel processes for completing complicated tasks that would otherwise be inefficient for normal serial and procedural processing
If you like PowerProcess, please consider donating
Located in /PowerProcess.class.php (line 43)
Current PowerProcess version
Callback array for setting callback functions based on signals that can be sent to the parent process
Boolean variable which determines whether or not to shutdown the control process (parent)
The name of the current thread. Used by WhoAmI()
Whether to log internal debug message
When logging is enabled, this points to the socket in which to write log messages.
Location to log information messages to.
Can be a file or php://stdout, php://stderr. Set to false to disable
The maximum number of concurrent threads that can be running at any given time.
This setting has an impact on performance for PowerProcess so play with it on the system you are on to determine a good value. 10 is a good place to start
Array which stores the thread data for the control process (parent) to manage running child threads
The pid of the parent process
Used after a process is forked to determine whether the new thread is to run the thread code
Session ID of parent session when process is daemonized
Signals to install for SignalDispatcher.
You can use any signal constant PNCTL supports
Data store for data that is to be passed to the child process which is to be spawned
The maximum number of seconds a thread will be allowed to run.
Set to 0 to disable a time limit (use with caution)
Sleep timer in micro seconds for the parent process to sleep between status checks using Tick()
Whether to add a timestamp to log output
PowerProcess constructor.
Returns an instanced PowerProcess object or dies on failure
Checks all running threads to make sure they are still running and their time limit has not been exceeded
If a thread has exceeded it's time limit, this method will kill that process and dispatch the special signal 'threadotl'
Executes specified program in the current process space
Returns the PID of the process that spawned this one
Get the status of a running thread by name or PID
Initialize the logging stream if enabled
Kill a thread by PID
Log a message
Determine whether a child pid has exited
Returns the PID of child which exited or 0
Registers a callback function for the signal dispatcher or for special signals used by PowerProcess
Special signals are:
Determines whether we should be running the control code or the thread code
Determines whether we should be running the child code
Send a signal to a process
Set the max number of threads that can be running concurrently
Set the max number of seconds a thread can run before being terminated
Initiates the shutdown procedure for PowerProcess
Handles dispatching of signals to user-defined callbacks
Spawn a new thread
Process signals to be dispatched and sleep for a number of microseconds
Documentation generated on Wed, 11 Jan 2012 16:04:12 -0600 by phpDocumentor 1.4.3