[ANNOUNCEMENT] PHP_Fork-0.1 (beta) Released.
| From: | PEAR Announce | Date: | Thu, 18 Mar 2004 10:52:48 +0000 |
| Subject: | [ANNOUNCEMENT] PHP_Fork-0.1 (beta) Released. | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-11360@lists.php.net to get a copy of this message | ||
The new PEAR package PHP_Fork-0.1 (beta) has been released at http://pear.php.net/.
Release notes
-------------
Initial release
Package Info
-------------
PHP_Fork class. Wrapper around the pcntl_fork() stuff
with a API set like Java language.
Practical usage is done by extending this class, and re-defining
the run() method.
[see basic example]
This way PHP developers can enclose logic into a class that extends
PHP_Fork, then execute the start() method that forks a child process.
Communications with the forked process is ensured by using a Shared Memory
Segment; by using a user-defined signal and this shared memory developers
can access to child process methods that returns a serializable variable.
The shared variable space can be accessed with the tho methods:
o void setVariable($name, $value)
o mixed getVariable($name)
$name must be a valid PHP variable name;
$value must be a variable or a serializable object.
Resources (db connections, streams, etc.) cannot be serialized and so they're not correctly
handled.
Requires PHP build with --enable-cli --with-pcntl --enable-shmop.
Only runs on *NIX systems, because Windows lacks of the pcntl ext.
@example simple_controller.php shows how to attach a controller to started pseudo-threads.
@example exec_methods.php shows a workaround to execute methods into the child process.
@example passing_vars.php shows variable exchange between the parent process and started
pseudo-threads.
@example basic.php a basic example, only two pseudo-threads that increment a counter simultaneously.
Related Links
-------------
Package home: http://pear.php.net/package/PHP_Fork
Changelog: http://pear.php.net/package-changelog.php?package=PHP_Fork
Download: http://pear.php.net/get/PHP_Fork-0.1.tgz
Authors
-------------
Luca Mariano <luca.mariano@email.it> (lead)