bin | ||
examples | ||
lib | ||
test | ||
travis | ||
.gitattributes | ||
.gitignore | ||
.php_cs.dist | ||
.travis.yml | ||
.valgrindrc | ||
composer.json | ||
LICENSE | ||
Makefile | ||
phpdoc.dist.xml | ||
phpunit.xml.dist | ||
README.md | ||
Vagrantfile |
True parallel processing using native multiple processes or threads for parallelizing code, without blocking.
amphp/parallel
a component for Amp that provides native threading, multiprocessing, process synchronization, shared memory, and task workers. Like other Amp components, this library uses Coroutines built from Promises and Generators to make writing asynchronous code more like writing synchronous code.
This library provides a means of parallelizing code without littering your application with complicated lock checking and inter-process communication.
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 dependency.
composer require amphp/sync
Requirements
- PHP 7.0+ (no extensions required)
Documentation
Documentation can be found on amphp.org/sync as well as in the ./docs
directory.
Versioning
amphp/sync
follows the semver semantic versioning specification like all other amphp
packages.
Security
If you discover any security related issues, please email me@kelunik.com
instead of using the issue tracker.
License
The MIT License (MIT). Please see LICENSE
for more information.
Development and Contributing
Want to hack on the source? A Vagrant 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
vagrant up && vagrant ssh
Once inside the VM, you can install PHP extensions with Pickle, switch versions with newphp VERSION
, and test for memory leaks with Valgrind.