PHPackages                             idimsh/parallel-processes - 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. [CLI &amp; Console](/categories/cli)
4. /
5. idimsh/parallel-processes

ActiveLibrary[CLI &amp; Console](/categories/cli)

idimsh/parallel-processes
=========================

Run multiple Symfony CLI processes in parallel.

v3.0.3(4y ago)013MITPHPPHP &gt;7.1

Since Aug 21Pushed 4y ago1 watchersCompare

[ Source](https://github.com/idimsh/parallel-processes)[ Packagist](https://packagist.org/packages/idimsh/parallel-processes)[ Docs](https://github.com/idimsh/parallel-processes)[ RSS](/packages/idimsh-parallel-processes/feed)WikiDiscussions main Synced today

READMEChangelogDependencies (8)Versions (6)Used By (0)

parallel-processes
==================

[](#parallel-processes)

[![Latest Version on Packagist](https://camo.githubusercontent.com/9ccff219aab713ba3c5dbc7d5b238854c903a8dbe009735b048b2516fe561c81/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6964696d73682f706172616c6c656c2d70726f6365737365732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/idimsh/parallel-processes)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/671e408c1ffe8114b97d4feb45aeb4f508e0387a960edcfcdff86f52bf733250/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f6964696d73682f706172616c6c656c2d70726f6365737365732f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/idimsh/parallel-processes)[![Coverage Status](https://camo.githubusercontent.com/bc46ed8cde5e88c7ed724081ee62b57ad895bce97b67d7818c8b8eb8a1038646/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f6964696d73682f706172616c6c656c2d70726f6365737365732e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/idimsh/parallel-processes/code-structure)[![Quality Score](https://camo.githubusercontent.com/a35206b09294e7cb7e79ee0ce4d2c4364aae608aac1ad05cd28f8c5f6dd4f320/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f6964696d73682f706172616c6c656c2d70726f6365737365732e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/idimsh/parallel-processes)[![Total Downloads](https://camo.githubusercontent.com/f804beff6c19fba82b1512fcc0909cf78ce573943a43b4c5b4482c9b8745d359/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6964696d73682f706172616c6c656c2d70726f6365737365732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/idimsh/parallel-processes)

\##*Still in progress ...*

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

[](#installation)

The preferred method of installation is via [Composer](http://getcomposer.org/). Run the following command to install the latest version of a package and add it to your project's `composer.json`:

```
composer require idimsh/parallel-processes
```

Purpose
-------

[](#purpose)

To be able to run multiple shell commands in parallel, leveraging [Symfony Process](https://symfony.com/doc/current/components/process.html)those running in the background. And be able to cease execution (stop all the processes) in case one of them failed.

Design
------

[](#design)

This package uses an event loop, currently [ReactPHP event-loop](https://github.com/reactphp/event-loop) is chosen, but this might change.
The event loop helps in being able to start the processes one by one in non blocking manner, and allowing monitoring them for non-zero exit faster.

Usage
-----

[](#usage)

Symfony Process can be constructed using an array or a string.
If constructed using an array, then each item will be shell escaped before forming the command line to be executed.
If constructed using a string, then it is assumed to already be shell escaped.

The second way is preferred.

On linux, exiting a running processes by signaling it works as long as the process is started using `exec`, otherwise, it can't really be stopped.

The best way is to construct the commands to be executed.

Example 1, no special handing.

```
$loop              = \React\EventLoop\Factory::create();
$newProcessFactory = new \idimsh\ParallelProcesses\NewProcessFactory();
$processesConfig   = \idimsh\ParallelProcesses\BackgroundProcessesConfig::create();

$parallel    = new \idimsh\ParallelProcesses\ParallelCliProcesses(
    $processesConfig,
    $newProcessFactory,
    $loop
);
$parallel->execWithLoop([
    'failed ls'         => \idimsh\ParallelProcesses\Command\SimpleCommand::fromString(
      'exec /bin/bash -c "ls -la /tmp/not-found"'
    )->setAsShellEscaped(true),

   'long failed grep exec in bash'         => \idimsh\ParallelProcesses\Command\SimpleCommand::fromString(
      'exec /bin/bash -c "sleep 3; grep --color -rHn \'random string not there\' /usr /var/"'
    )->setAsShellEscaped(true),
]);
$loop->run();
```

The two commands:

- `ls -la /tmp/not-found`
- `grep --color -rHn \'random string not there\' /usr /var/`

Will both run in parallel, and will both fail, the long running `grep` will continue to run despite that `ls` has failed already. Nothing will be output, since output is delegated to a logger interface and to callbacks.

Credits
-------

[](#credits)

- [Abdulrahman Dimashki](https://github.com/idimsh)
- [All Contributors](../../contributors)

License
-------

[](#license)

Released under MIT License - see the [License File](LICENSE) for details.

###  Health Score

23

—

LowBetter than 26% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

4

Last Release

1776d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6051f256445126a33260284644052c0eafa146bb2877bdd46522a280676e3ccd?d=identicon)[idimsh](/maintainers/idimsh)

---

Top Contributors

[![idimsh](https://avatars.githubusercontent.com/u/5890777?v=4)](https://github.com/idimsh "idimsh (9 commits)")

---

Tags

phpclisymfonysymfony-processparallel-processes

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/idimsh-parallel-processes/health.svg)

```
[![Health](https://phpackages.com/badges/idimsh-parallel-processes/health.svg)](https://phpackages.com/packages/idimsh-parallel-processes)
```

###  Alternatives

[matomo/matomo

Matomo is the leading Free/Libre open analytics platform

21.7k38.9k](/packages/matomo-matomo)[laravel/framework

The Laravel Framework.

34.8k543.8M20.0k](/packages/laravel-framework)[tempest/framework

The PHP framework that gets out of your way.

2.2k34.4k15](/packages/tempest-framework)[league/climate

PHP's best friend for the terminal. CLImate allows you to easily output colored text, special formats, and more.

1.9k14.7M298](/packages/league-climate)[drupal/core

Drupal is an open source content management platform powering millions of websites and applications.

21866.0M1.7k](/packages/drupal-core)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.4M203](/packages/sulu-sulu)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
