PHPackages                             amphp/parallel - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Queues &amp; Workers](/categories/queues)
4. /
5. amphp/parallel

ActiveLibrary[Queues &amp; Workers](/categories/queues)

amphp/parallel
==============

Parallel processing component for Amp.

v2.3.3(6mo ago)85046.2M—6.4%68[20 issues](https://github.com/amphp/parallel/issues)20MITPHPPHP &gt;=8.1CI passing

Since Jun 16Pushed 2d ago15 watchersCompare

[ Source](https://github.com/amphp/parallel)[ Packagist](https://packagist.org/packages/amphp/parallel)[ Docs](https://github.com/amphp/parallel)[ GitHub Sponsors](https://github.com/amphp)[ RSS](/packages/amphp-parallel/feed)WikiDiscussions 2.x Synced 1mo ago

READMEChangelog (10)Dependencies (14)Versions (50)Used By (20)

amphp/parallel
==============

[](#amphpparallel)

AMPHP is a collection of event-driven libraries for PHP designed with fibers and concurrency in mind. `amphp/parallel` provides *true parallel processing* for PHP using multiple processes or 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 processes.

[![Latest Release](https://camo.githubusercontent.com/b6f5d1ab700f7b45741796118615c2bad17ecdcb95e45bcbbf7dd7f6e86111e6/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f616d7068702f706172616c6c656c2e7376673f7374796c653d666c61742d737175617265)](https://github.com/amphp/parallel/releases)[![MIT License](https://camo.githubusercontent.com/942e017bf0672002dd32a857c95d66f28c5900ab541838c6c664442516309c8a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e7376673f7374796c653d666c61742d737175617265)](https://github.com/amphp/parallel/blob/master/LICENSE)

Requirements
------------

[](#requirements)

- PHP 8.1+

#### Optional requirements to use threads instead of processes

[](#optional-requirements-to-use-threads-instead-of-processes)

- PHP 8.2+ ZTS
- [`ext-parallel`](https://github.com/krakjoe/parallel)

Installation
------------

[](#installation)

This package can be installed as a [Composer](https://getcomposer.org/) dependency.

```
composer require amphp/parallel
```

Usage
-----

[](#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.

```
