This is high performance PHP Mutilprocessing Task Manager written in PHP.
-
By using this tool, PHP scripts can be invoked asynchronously based on multi processes, and finally wait for each process to return results, saving lots of time.
-
graceful and efficient
You can use composer to install this library from the command line.
composer require sinacms/multiprocess<?php
use Mutilprocessing\Async;
Async::create()->run('task.php', ['runTest'.$i]);<?php
use Mutilprocessing\Async;
Async::join(function($code, $out, $err) use(&$outData) {
// var_dump($code, $out, $err);
$outData = $out;
});<?php
use Mutilprocessing\Async;
Async::discard();- public static function create()
- public static function run($scriptname, $args, $envs = [])
- public static function discard()
- public static function join(callable $logHandler = null)