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

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

lukaszaleckas/laravel-concurrency
=================================

v1.0.0(3y ago)09PHPPHP ^8.1

Since Apr 15Pushed 3y ago1 watchersCompare

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

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

Laravel Concurrency
===================

[](#laravel-concurrency)

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

[](#installation)

1. Run:

```
composer require lukaszaleckas/laravel-concurrency

```

Service provider should be automatically registered, if not add

```
LaravelConcurrency\ConcurrencyServiceProvider::class
```

to your application's `app.php`.

2. Publish configuration file:

```
php artisan vendor:publish --provider="LaravelConcurrency\ConcurrencyServiceProvider"

```

3. Run migrations to create `tasks` table:

```
php artisan migrate

```

Usage Example
-------------

[](#usage-example)

### Create a task

[](#create-a-task)

Create a new task which implements `LaravelConcurrency\Contracts\TaskInterface`:

```
use LaravelConcurrency\Contracts\TaskInterface;

class SleepForTwoSeconds implements TaskInterface
{
    public function run(): mixed
    {
        sleep(2);

        return null;
    }
}
```

Tasks return result which you want to get after running them. This can be anything you want, but it needs to be serializable.

In this example we just return `null`.

### Spawn task workers

[](#spawn-task-workers)

Tasks are run by tasks workers. To spawn a task worker run:

```
php artisan concurrency:run-task-worker

```

One worker can run only one task at a time. So we'll spawn two of those for this example.

### Run tasks

[](#run-tasks)

Now run a couple of these tasks concurrently:

```
use LaravelConcurrency\Facades\Concurrency;

Concurrency::wait(
    new SleepForTwoSeconds(),
    new SleepForTwoSeconds()
)
```

If you notice, these tasks were both completed in ~2s, which means they've run concurrently.

You should also notice task workers logs that indicate which task ran in which process.

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity53

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

1123d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/30416654c84b25a433b4c1c5360c8fac347b923247750b19a0310e45dc4aa5f4?d=identicon)[lukaszaleckas](/maintainers/lukaszaleckas)

---

Top Contributors

[![lukaszaleckas](https://avatars.githubusercontent.com/u/47445386?v=4)](https://github.com/lukaszaleckas "lukaszaleckas (13 commits)")

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/lukaszaleckas-laravel-concurrency/health.svg)

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

###  Alternatives

[wireui/wireui

TallStack components

1.8k1.3M16](/packages/wireui-wireui)[livewire/volt

An elegantly crafted functional API for Laravel Livewire.

4195.3M84](/packages/livewire-volt)[ramonrietdijk/livewire-tables

Dynamic tables for models with Laravel Livewire

21147.4k](/packages/ramonrietdijk-livewire-tables)

PHPackages © 2026

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