PHPackages                             igorsgm/illuminate-concurrency - 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. igorsgm/illuminate-concurrency

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

igorsgm/illuminate-concurrency
==============================

Standalone extraction of Laravel's Illuminate Concurrency component. Run tasks concurrently using process, fork, or sync drivers.

v12.0.0(2mo ago)02↓50%MITPHPPHP ^8.2

Since Mar 5Pushed 2mo agoCompare

[ Source](https://github.com/igorsgm/illuminate-concurrency)[ Packagist](https://packagist.org/packages/igorsgm/illuminate-concurrency)[ Docs](https://github.com/igorsgm/illuminate-concurrency)[ RSS](/packages/igorsgm-illuminate-concurrency/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (5)Versions (2)Used By (0)

Illuminate Concurrency
======================

[](#illuminate-concurrency)

A standalone extraction of [Laravel's Concurrency](https://laravel.com/docs/12.x/concurrency) component for use outside of the full `laravel/framework` package.

Why does this package exist?
----------------------------

[](#why-does-this-package-exist)

Laravel ships many of its components as standalone `illuminate/*` packages, allowing developers to use them in non-Laravel projects or micro-frameworks. However, **the Concurrency component has not yet been split into its own `illuminate/concurrency` package** — it only lives inside the monolithic `laravel/framework` repository.

This package extracts the Concurrency component exactly as it exists in `laravel/framework`, making it installable as a first-class Composer dependency without pulling in the entire framework.

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

[](#installation)

```
composer require igorsgm/illuminate-concurrency
```

*Optional:* Before using the `fork` driver, you need to install the `spatie/fork` package:

```
composer require spatie/fork
```

Concurrency (from Laravel Docs)
===============================

[](#concurrency-from-laravel-docs)

Introduction
------------

[](#introduction)

Sometimes you may need to execute several slow tasks which do not depend on one another. In many cases, significant performance improvements can be realized by executing the tasks concurrently. Laravel's `Concurrency` facade provides a simple, convenient API for executing closures concurrently.

#### How it Works

[](#how-it-works)

Laravel achieves concurrency by serializing the given closures and dispatching them to a hidden Artisan CLI command, which unserializes the closures and invokes it within its own PHP process. After the closure has been invoked, the resulting value is serialized back to the parent process.

The `Concurrency` facade supports three drivers:

DriverDescriptionRequires`process`Runs tasks in parallel child processes (default)—`fork`Uses `pcntl_fork` for true parallel execution. Offers improved performance compared to the default `process` driver, but it may only be used within PHP's CLI context, as PHP does not support forking during web requests.`spatie/fork`, CLI only`sync`Primarily useful during testing when you want to disable all concurrency and simply execute the given closures in sequence within the parent process.—Running Concurrent Tasks
------------------------

[](#running-concurrent-tasks)

To run concurrent tasks, you may invoke the `Concurrency` facade's `run` method. The `run` method accepts an array of closures which should be executed simultaneously in child PHP processes:

```
use Illuminate\Support\Facades\Concurrency;
use Illuminate\Support\Facades\DB;

[$userCount, $orderCount] = Concurrency::run([
    fn () => DB::table('users')->count(),
    fn () => DB::table('orders')->count(),
]);
```

To use a specific driver, you may use the `driver` method:

```
$results = Concurrency::driver('fork')->run(...);
```

Or, to change the default concurrency driver, you should publish the `concurrency` configuration file via the `config:publish` Artisan command and update the `default` option within the file:

```
php artisan config:publish concurrency
```

Deferring Concurrent Tasks
--------------------------

[](#deferring-concurrent-tasks)

If you would like to execute an array of closures concurrently, but are not interested in the results returned by those closures, you should consider using the `defer` method. When the `defer` method is invoked, the given closures are not executed immediately. Instead, Laravel will execute the closures concurrently after the HTTP response has been sent to the user:

```
use App\Services\Metrics;
use Illuminate\Support\Facades\Concurrency;

Concurrency::defer([
    fn () => Metrics::report('users'),
    fn () => Metrics::report('orders'),
]);
```

Source
------

[](#source)

This package mirrors the source code from:

- [`laravel/framework` — `src/Illuminate/Concurrency`](https://github.com/laravel/framework/tree/12.x/src/Illuminate/Concurrency)
- [`laravel/framework` — Concurrency Facade](https://github.com/laravel/framework/blob/12.x/src/Illuminate/Support/Facades/Concurrency.php)

License
-------

[](#license)

The MIT License (MIT). See [LICENSE.md](LICENSE.md) for details.

###  Health Score

37

—

LowBetter than 83% of packages

Maintenance86

Actively maintained with recent releases

Popularity2

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity46

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

69d ago

### Community

Maintainers

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

---

Top Contributors

[![igorsgm](https://avatars.githubusercontent.com/u/14129843?v=4)](https://github.com/igorsgm "igorsgm (2 commits)")

---

Tags

asyncconcurrencylaravelprocessparallelforkilluminatemultiprocessing

### Embed Badge

![Health badge](/badges/igorsgm-illuminate-concurrency/health.svg)

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

###  Alternatives

[illuminate/queue

The Illuminate Queue package.

20331.4M1.2k](/packages/illuminate-queue)[spatie/laravel-health

Monitor the health of a Laravel application

85810.0M83](/packages/spatie-laravel-health)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9682.1M97](/packages/roots-acorn)[laravel/ai

The official AI SDK for Laravel.

732506.3k60](/packages/laravel-ai)[laravel-zero/framework

The Laravel Zero Framework.

3371.4M369](/packages/laravel-zero-framework)[harris21/laravel-fuse

Circuit breaker for Laravel queue jobs. Protect your workers from cascading failures.

3786.5k](/packages/harris21-laravel-fuse)

PHPackages © 2026

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