dev-master
9999999-devA PHP 5.4 process executor implementation.
LGPL-3.0
by Julien Pons
process fork ipc mutli-process
v1.0.0
1.0.0.0A PHP 5.4 process executor implementation.
LGPL-3.0
by Julien Pons
process fork ipc mutli-process
A PHP 5.4 process executor implementation.
Php asynchronous multi-processing library, (*1)
<?php use LightProcessExecutor\Event\MessageEvent; use LightProcessExecutor\EventListener\RouterEventListener; use LightProcessExecutor\LightProcessExecutor; declare(ticks=1) ; require __DIR__ . '/vendor/autoload.php'; // Define a simple router listener class TestListener implements RouterEventListener { public function onInterruptReceive(MessageEvent $e){ // Not to be used, the urgent flag in the routing protocol is obsolete and <b>should NOT</b> be used } public function onPeerShutdown(LightProcessExecutor $executor, $pid, array $lostMessages){ // invoked when a peer shuts down (the peer is necessarily connected to the process receiving the event) } public function onMessageReceived(MessageEvent $e){ // invoked when a message is received } public function onMessageSent(MessageEvent $e){ // invoked when this process has fully written its message to the targeted peers } public function onRouterError($operation, $errno, $errstr, \Exception $e = NULL){ // invoked when the router raises an error that the application programmer might want to handle } public function getPriority(){ return 0; } } $root = new LightProcessExecutor(); $root->addRouterMessageListener(new TestListener()); // Might want to fork processes here $root->fork(); $pid2 = $root->fork("", null, function($executor){ $executor->fork(); }); $root->submit("test", null, false, false, true); $root->submit("for pid2 only", $pid2); $root->loop();
A PHP 5.4 process executor implementation.
LGPL-3.0
process fork ipc mutli-process
A PHP 5.4 process executor implementation.
LGPL-3.0
process fork ipc mutli-process