Download the PHP package sinacms/multiprocess without Composer
On this page you can find all versions of the php package sinacms/multiprocess. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download sinacms/multiprocess
More information about sinacms/multiprocess
Files in sinacms/multiprocess
Package multiprocess
Short Description a tool for PHP multi process asynchronous tasks manage
License Apache-2.0
Informations about the package multiprocess
PHP Mutilprocess
This is high performance PHP Mutilprocessing Task Manager written in PHP, compatible with PHP-FPM and CLI.
这是一个用PHP编写的高性能PHP多进程异步任务管理器,与PHP FPM和CLI兼容。
Contents
- Feature
- Installation
- Usage
- Async-Multi-Tasks
- Documentation
- Async
Feature
-
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
-
can get callable function return value
-
You can specify the PHP path for asynchronous execution scripts by specifying the phpBin parameter.
- Exception Handling
Installation
You can use composer to install this library from the command line.
Usage
distribute tasks and async execute
distribute tasks by a simple function and async execute
!!! WARN:please don't insert a '&&&' string in echo and return for some reason it will break down the program run
sync wait for all process end
outData structure:
echos represent echos in execute
returns represent return in execute
getArgs passed from Async::start
clean all task
Documentation
-
Async
-
option shorthand
-
- public static function create()
- public static function start($scriptname, $args, $phpBin="", $envs = [])
- public function startFunc(callable $function, $args = [], $phpBin="")
- public static function discard()
- public static function wait(callable $logHandler = null)
- public static function getArgs($argv = null)
- public static function getReturn($out)
-
FunctionParser
-
option shorthand
-
- public static function genTmp(callable $function)
Todo
- regCallback for each execution (on process)
- add multi execution unit and start once