parallel-master

所属分类:其他
开发工具:PHP-PERL
文件大小:60KB
下载次数:0
上传日期:2019-10-13 01:03:01
上 传 者Shawn85
说明:  Parallel processing for PHP based on Amp

文件列表:
.php_cs.dist (302, 2019-08-28)
.valgrindrc (78, 2019-08-28)
LICENSE (1077, 2019-08-28)
Makefile (847, 2019-08-28)
Vagrantfile (413, 2019-08-28)
appveyor.yml (1325, 2019-08-28)
composer.json (1512, 2019-08-28)
docs (0, 2019-08-28)
docs\.shared (0, 2019-08-28)
docs\Gemfile (121, 2019-08-28)
docs\Gemfile.lock (6520, 2019-08-28)
docs\_config.yml (463, 2019-08-28)
docs\index.md (1494, 2019-08-28)
docs\processes.md (1884, 2019-08-28)
docs\worker-pool.md (2322, 2019-08-28)
docs\workers.md (3216, 2019-08-28)
lib (0, 2019-08-28)
lib\Context (0, 2019-08-28)
lib\Context\Context.php (771, 2019-08-28)
lib\Context\ContextException.php (86, 2019-08-28)
lib\Context\Internal (0, 2019-08-28)
lib\Context\Internal\ParallelHub.php (1637, 2019-08-28)
lib\Context\Internal\ProcessHub.php (4138, 2019-08-28)
lib\Context\Internal\Thread.php (4716, 2019-08-28)
lib\Context\Internal\process-runner.php (3688, 2019-08-28)
lib\Context\Parallel.php (12168, 2019-08-28)
lib\Context\Process.php (11383, 2019-08-28)
lib\Context\StatusError.php (77, 2019-08-28)
lib\Context\Thread.php (9289, 2019-08-28)
lib\Sync (0, 2019-08-28)
lib\Sync\Channel.php (1296, 2019-08-28)
lib\Sync\ChannelException.php (83, 2019-08-28)
lib\Sync\ChannelParser.php (2531, 2019-08-28)
lib\Sync\ChannelledSocket.php (1413, 2019-08-28)
lib\Sync\ChannelledStream.php (2255, 2019-08-28)
lib\Sync\ExitFailure.php (1397, 2019-08-28)
lib\Sync\ExitResult.php (295, 2019-08-28)
... ...

parallel

Build Status Code Coverage Release License

`amphp/parallel` provides *true parallel processing* for PHP using multiple processes or native threads, *without blocking and no extensions required*. To be as flexible as possible, this library comes with a collection of non-blocking concurrency tools that can be used independently as needed, as well as an "opinionated" worker API that allows you to assign units of work to a pool of worker threads or processes. ## Installation This package can be installed as a [Composer](https://getcomposer.org/) dependency. ```bash composer require amphp/parallel ``` ## Usage The basic usage of this library is to submit blocking tasks to be executed by a worker pool in order to avoid blocking the main event loop. ```php $response) { \printf("Read %d bytes from %s\n", \strlen($response), $url); } ``` [`file_get_contents`](https://secure.php.net/file_get_contents) is just used as an example for a blocking function here. If you just want to fetch multiple HTTP resources concurrently, it's better to use [Artax](https://amphp.org/artax/), our non-blocking HTTP client. The functions you call must be predefined or autoloadable by Composer so they also exist in the worker processes. Instead of simple callables, you can also enqueue `Task` instances with `Amp\Parallel\Worker\enqueue()`. ## Documentation Documentation can be found on [amphp.org/parallel](https://amphp.org/parallel/) as well as in the [`./docs`](./docs) directory. ## Versioning `amphp/parallel` follows the [semver](http://semver.org/) semantic versioning specification like all other `amphp` packages. ## Security If you discover any security related issues, please email [`me@kelunik.com`](mailto:me@kelunik.com) instead of using the issue tracker. ## License The MIT License (MIT). Please see [`LICENSE`](./LICENSE) for more information. ## Development and Contributing Want to hack on the source? A [Vagrant](http://vagrantup.com) box is provided with the repository to give a common development environment for running concurrent threads and processes, and comes with a bunch of handy tools and scripts for testing and experimentation. Starting up and logging into the virtual machine is as simple as ```bash vagrant up && vagrant ssh ``` Once inside the VM, you can install PHP extensions with [Pickle](https://github.com/FriendsOfPHP/pickle), switch versions with `newphp VERSION`, and test for memory leaks with [Valgrind](http://valgrind.org).

近期下载者

相关文件


收藏者