PHPackages                             sparallel/sparallel - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. sparallel/sparallel

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

sparallel/sparallel
===================

Parallel PHP via processes

v0.0.0(1y ago)0125MITPHPPHP ^8.2

Since Apr 24Pushed 8mo ago1 watchersCompare

[ Source](https://github.com/sprust/sparallel)[ Packagist](https://packagist.org/packages/sparallel/sparallel)[ RSS](/packages/sparallel-sparallel/feed)WikiDiscussions master Synced today

READMEChangelog (2)Dependencies (6)Versions (7)Used By (0)

Parallel PHP via processes (another)
====================================

[](#parallel-php-via-processes-another)

⚠️ Don't use a writing to STDOUT inside workers⚠️ VarDumper is muted inside workersexample
-------

[](#example)

Init

```
$workers = \SParallel\TestsImplementation\TestContainer::resolve()
    ->get(\SParallel\SParallelWorkers::class);

$callbacks = [
    'first'  => static fn() => 'first',
    'second' => static fn() => throw new RuntimeException('second'),
     'third'  => static function(
        \SParallel\Entities\Context $context,
        \SParallel\Contracts\EventsBusInterface $eventsBus // DI support
    ) {
        $context->check();

        return 'third';
    },
];
```

Wait all tasks to finish and get results

```
/**
 * @var \SParallel\SParallelWorkers $workers
 * @var array $callbacks
 */

$results = $workers->wait(
    callbacks: $callbacks,
    timeoutSeconds: 2,
);

if ($results->hasFailed()) {
    foreach ($results->getFailed() as $key => $failedResult) {
        echo "$taskKey: ERROR: " . ($failedResult->exception?->getMessage() ?: 'unknown error') . "\n";
    }
}

foreach ($results->getResults() as $result) {
    if ($result->exception) {
        continue;
    }

    echo "$taskKey: SUCCESS: " . $result->result . "\n";
}
```

Run tasks and get results at any task completion

```
/**
 * @var \SParallel\SParallelWorkers $workers
 * @var array $callbacks
 */

$results = $workers->run(
    callbacks: $callbacks,
    timeoutSeconds: 2,
);

foreach ($results as $taskKey => $result) {
    if ($result->exception) {
        echo "$taskKey: ERROR: " . ($result->exception->getMessage() ?: 'unknown error') . "\n";

        continue;
    }

    echo "$taskKey: SUCCESS: " . $result->result . "\n";
}
```

###  Health Score

31

—

LowBetter than 66% of packages

Maintenance53

Moderate activity, may be stable

Popularity11

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity44

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

Unknown

Total

1

Last Release

417d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/eb5944a5bfd39c64f072b6c43fc6a315e4eea4d14c409538d1fd6de61a234847?d=identicon)[spp28rus](/maintainers/spp28rus)

---

Top Contributors

[![sprust](https://avatars.githubusercontent.com/u/57857525?v=4)](https://github.com/sprust "sprust (271 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/sparallel-sparallel/health.svg)

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

###  Alternatives

[laravel/framework

The Laravel Framework.

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

The PHP framework that gets out of your way.

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

The Symfony PHP framework

31.4k87.2M2.2k](/packages/symfony-symfony)[matomo/matomo

Matomo is the leading Free/Libre open analytics platform

21.7k38.9k](/packages/matomo-matomo)[civicrm/civicrm-core

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

751291.4k43](/packages/civicrm-civicrm-core)[composer/composer

Composer helps you declare, manage and install dependencies of PHP projects. It ensures you have the right stack everywhere.

29.5k196.2M3.1k](/packages/composer-composer)

PHPackages © 2026

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