PHPackages                             fereydooni/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. [Queues &amp; Workers](/categories/queues)
4. /
5. fereydooni/laravel-concurrency

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

fereydooni/laravel-concurrency
==============================

A robust concurrent processing system for Laravel inspired by Go's concurrency model

00PHP

Since Apr 24Pushed 1y ago1 watchersCompare

[ Source](https://github.com/Behnamfe76/laravel-concurrency)[ Packagist](https://packagist.org/packages/fereydooni/laravel-concurrency)[ RSS](/packages/fereydooni-laravel-concurrency/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

ConcurrentFlow for Laravel
==========================

[](#concurrentflow-for-laravel)

A robust concurrent processing system for Laravel inspired by Go's concurrency model (goroutines and channels) using PHP attributes.

Features
--------

[](#features)

- Concurrent task execution using PHP attributes
- Channel-based communication between tasks
- Task orchestration with priorities and dependencies
- Graceful error handling and retries
- Monitoring of task status and performance
- Flexible configuration options

Requirements
------------

[](#requirements)

- PHP 8.1+
- Laravel 10.x

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

[](#installation)

```
composer require fereydooni/laravel-concurrency
```

Publish the configuration file:

```
php artisan vendor:publish --provider="Fereydooni\ConcurrentFlow\ConcurrentFlowServiceProvider"
```

Run the migrations:

```
php artisan migrate
```

Usage
-----

[](#usage)

### Defining Concurrent Tasks

[](#defining-concurrent-tasks)

Use the `ConcurrentTask` attribute to define methods that should be executed concurrently:

```
use Fereydooni\ConcurrentFlow\Attributes\ConcurrentTask;

class DataProcessor
{
    #[ConcurrentTask(name: 'process_user_data', priority: 'high', maxRetries: 3)]
    public function processUserData($data)
    {
        // Process data
        return $processedData;
    }
}
```

### Using Channels for Communication

[](#using-channels-for-communication)

Use the `Channel` attribute to define methods that produce or consume data via channels:

```
use Fereydooni\ConcurrentFlow\Attributes\Channel;

class DataProcessor
{
    #[Channel(name: 'user_data', buffer: 100)]
    public function processAndSend($data)
    {
        // Process data and send to channel
        return $processedData;
    }
}
```

### Running Tasks and Using Channels

[](#running-tasks-and-using-channels)

```
use Fereydooni\ConcurrentFlow\ConcurrencyManager;

// Get the concurrency manager
$manager = app(ConcurrencyManager::class);

// Create and run a task
$task = $manager->createTask(DataProcessor::class, 'processUserData', [$userData]);
$manager->runTask($task);

// Send data to a channel
$manager->sendToChannel('user_data', $someData);

// Receive data from a channel
$result = $manager->receiveFromChannel('user_data');
```

### Task Orchestration

[](#task-orchestration)

```
// Run multiple tasks in parallel
$tasks = [
    $manager->createTask(DataProcessor::class, 'processUserData', [$userData1]),
    $manager->createTask(DataProcessor::class, 'processUserData', [$userData2]),
];
$results = $manager->runParallel($tasks);

// Set up task dependencies
$task1 = $manager->createTask(DataProcessor::class, 'step1', [$data]);
$task2 = $manager->createTask(DataProcessor::class, 'step2', []);
$manager->addDependency($task2, $task1); // task2 depends on task1
$manager->runWithDependencies($task2);
```

Configuration
-------------

[](#configuration)

The package configuration file (`concurrent-flow.php`) allows you to customize:

- Concurrency driver (pcntl, queue)
- Default channel buffer size
- Default task priority
- Task timeout settings
- Storage backend for channels

Error Handling
--------------

[](#error-handling)

Tasks will be retried based on the `maxRetries` setting. All task executions are logged in the database for monitoring and debugging.

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE) for more information.

###  Health Score

14

—

LowBetter than 1% of packages

Maintenance34

Infrequent updates — may be unmaintained

Popularity0

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity15

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/101217538?v=4)[Behnam Fereydooni](/maintainers/Behnamfe76)[@Behnamfe76](https://github.com/Behnamfe76)

---

Top Contributors

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

### Embed Badge

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

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

###  Alternatives

[league/geotools

Geo-related tools PHP 7.3+ library

1.4k5.6M31](/packages/league-geotools)[illuminate/bus

The Illuminate Bus package.

6046.3M544](/packages/illuminate-bus)[uecode/qpush-bundle

Asynchronous processing for Symfony using Push Queues

1672.5M2](/packages/uecode-qpush-bundle)[belvg/module-sqs

N/A

1544.6k](/packages/belvg-module-sqs)[bsidev/bitrix-queue

Queues for Bitrix CMS

232.8k](/packages/bsidev-bitrix-queue)[mayconbordin/l5-stomp-queue

Stomp Queue Driver for Laravel 5

121.1k](/packages/mayconbordin-l5-stomp-queue)

PHPackages © 2026

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