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)0123MITPHPPHP ^8.2

Since Apr 24Pushed 7mo ago1 watchersCompare

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

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

32

—

LowBetter than 72% of packages

Maintenance58

Moderate activity, may be stable

Popularity10

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

370d 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

[civicrm/civicrm-core

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

728272.9k20](/packages/civicrm-civicrm-core)[sulu/sulu

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

1.3k1.3M152](/packages/sulu-sulu)[ecotone/ecotone

Supporting you in building DDD, CQRS, Event Sourcing applications with ease.

558549.8k17](/packages/ecotone-ecotone)[drupal/core-recommended

Locked core dependencies; require this project INSTEAD OF drupal/core.

6939.5M343](/packages/drupal-core-recommended)[kimai/kimai

Kimai - Time Tracking

4.6k7.4k1](/packages/kimai-kimai)[contao/core-bundle

Contao Open Source CMS

1231.6M2.4k](/packages/contao-core-bundle)

PHPackages © 2026

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