Detailed Description
Definition at line 31 of file Unix.php.
Constructor & Destructor Documentation
__construct |
( |
$ |
puid = null , |
|
|
$ |
guid = null , |
|
|
$ |
umask = null |
|
) |
| |
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.
- Parameters:
-
integer | $puid | |
integer | $guid | |
integer | $umask | |
- Exceptions:
-
Definition at line 144 of file Unix.php.
Stop the child on destruction
Definition at line 186 of file Unix.php.
Member Function Documentation
_callCallbackMethod |
( |
$ |
methodName, |
|
|
array $ |
argList = array() , |
|
|
$ |
type = self::VOID_METHOD |
|
) |
| [protected] |
This is called from within the parent; all the communication stuff is done here.
- Parameters:
-
string | $methodName | |
array | $argList | |
string | $type | |
- Returns:
- mixed
Definition at line 385 of file Unix.php.
_run |
( |
) |
[abstract, protected] |
This method actually implements the pseudo-thread logic.
- Returns:
- void
_setAlive |
( |
) |
[protected] |
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...
- Returns:
- void
Definition at line 370 of file Unix.php.
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:
- integer
Definition at line 343 of file Unix.php.
Returns the PID of the current pseudo-thread.
- Returns:
- integer
Definition at line 355 of file Unix.php.
Get a variable from the shared memory segment. Returns NULL if the variable doesn't exist.
- Parameters:
-
- Returns:
- mixed
Definition at line 322 of file Unix.php.
Test if the pseudo-thread is already started.
- Returns:
- boolean
Definition at line 290 of file Unix.php.
setVariable |
( |
$ |
name, |
|
|
$ |
value |
|
) |
| |
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.
- Parameters:
-
- Exceptions:
-
- Returns:
- void
Definition at line 305 of file Unix.php.
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).
- Exceptions:
-
- Returns:
- void
Definition at line 207 of file Unix.php.
Causes the current thread to die.
The relative process is killed and disappears immediately from the processes list.
- Returns:
- boolean
Definition at line 269 of file Unix.php.
Field Documentation
Return method
Definition at line 41 of file Unix.php.
Void method
Definition at line 36 of file Unix.php.
The documentation for this class was generated from the following file:
- E:/E/GEAMP/www/openbiz/openbiz/others/ZendX/Console/Process/Unix.php