Download the PHP package amphp/parallel-functions without Composer
On this page you can find all versions of the php package amphp/parallel-functions. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download amphp/parallel-functions
More information about amphp/parallel-functions
Files in amphp/parallel-functions
Package parallel-functions
Short Description Parallel processing made simple.
License MIT
Informations about the package parallel-functions
parallel-functions
AMPHP is a collection of event-driven libraries for PHP designed with fibers and concurrency in mind.
amphp/parallel-functions
provides a utility function which wraps a callable into another callable which will execute on another process or thread. All data within the callable object or closure must be serializable.
See the Worker
and Task
interfaces in amphp/parallel
for a more flexible and customizable API for running tasks in parallel.
Installation
This package can be installed as a Composer dependency.
Requirements
- PHP 8.1+
Example
Note that file_get_contents()
is being used here as an example blocking function (that is, a function which halts the process while awaiting I/O).
We recommend performing HTTP requests using amphp/http-client
.
The best functions to parallelize are those which perform many CPU-intensive calcuations or blocking functions which would be difficult or time-consuming to implement in a non-blocking way.
Further examples can be found in the ./examples
directory.
Versioning
amphp/parallel-functions
follows the semver semantic versioning specification like all other amphp
packages.
Security
If you discover any security related issues, please use the private security issue reporter instead of using the public issue tracker.
License
The MIT License (MIT). Please see LICENSE
for more information.
All versions of parallel-functions with dependencies
amphp/amp Version ^3
amphp/parallel Version ^2.2.3
amphp/serialization Version ^1
amphp/sync Version ^2.1
laravel/serializable-closure Version ^1.3