PHPackages                             fiberflow/fiberflow - 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. fiberflow/fiberflow

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

fiberflow/fiberflow
===================

Revolutionary Laravel queue worker using PHP Fibers for cooperative multitasking and 10x throughput

v0.9.0(3mo ago)502MITPHPPHP ^8.2CI failing

Since Feb 4Pushed 3mo ago1 watchersCompare

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

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

FiberFlow
=========

[](#fiberflow)

[![Latest Release](https://camo.githubusercontent.com/60f89d0c7717d2b57f7d6094b78d1a5d3ce8accaddecd3f65a198d0fc5ed90a8/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f72656c656173652f76697267696c6861776b696e7330302f6669626572666c6f773f7374796c653d666c61742d737175617265)](https://github.com/virgilhawkins00/fiberflow/releases)[![GitHub Tests Action Status](https://camo.githubusercontent.com/987428dc12082d4f2669e8e1c8ec42a8df373c6b17873bf0137db22cbac24d21/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f76697267696c6861776b696e7330302f6669626572666c6f772f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/virgilhawkins00/fiberflow/actions?query=workflow%3Arun-tests+branch%3Amain)[![PHP Version](https://camo.githubusercontent.com/2055c5aba3a3e30464082c61e6d106705b5a533ae2094a2f45775db3eb3c210b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344382e322d3838393242463f7374796c653d666c61742d737175617265)](https://www.php.net/)[![Laravel Version](https://camo.githubusercontent.com/9548a695f9568cbf7e46bd1a25cc9dc61d916a9419ab8c35e54ed61d6b405d27/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c61726176656c2d31312e7825323025374325323031322e782d4646324432303f7374796c653d666c61742d737175617265)](https://laravel.com)[![License](https://camo.githubusercontent.com/7553b9396fe8e2dd2195f6a59bb6f4420e80b9ff6459b001535600fa343818e6/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f76697267696c6861776b696e7330302f6669626572666c6f773f7374796c653d666c61742d737175617265)](LICENSE)

**FiberFlow** is a revolutionary Laravel queue worker that leverages PHP 8.1+ Fibers to enable **true cooperative multitasking** within a single process. Process 10,000 HTTP requests using only 100MB of RAM by suspending jobs during I/O operations instead of blocking the entire worker.

🚀 The Problem
-------------

[](#-the-problem)

Traditional Laravel queue workers operate sequentially: one job at a time, one process per job. When a job makes an HTTP request that takes 2 seconds to respond, the worker process (consuming 30-50MB of RAM) sits idle, waiting. To scale, you spawn more processes, consuming gigabytes of memory.

**FiberFlow changes the game.**

✨ The Solution
--------------

[](#-the-solution)

Using PHP Fibers and the Revolt event loop, FiberFlow allows multiple jobs to run concurrently in a single worker process. When a job waits for I/O (HTTP requests, database queries with async drivers), the Fiber suspends, allowing other jobs to execute. The result:

- **70% reduction in infrastructure costs** for I/O-heavy workloads
- **10x throughput** for webhook processing, API integrations, and web scraping
- **Zero configuration** for basic usage - drop-in replacement for `queue:work`
- **Pure PHP** - no Swoole, no RoadRunner, no PECL extensions required

📋 Requirements
--------------

[](#-requirements)

- PHP 8.2+ (Fibers introduced in 8.1, but 8.2+ recommended for stability)
- Laravel 11.x or 12.x
- Composer 2.0+

📦 Installation
--------------

[](#-installation)

Install via Composer:

```
composer require fiberflow/fiberflow
```

Publish the configuration file (optional):

```
php artisan vendor:publish --tag=fiberflow-config
```

🎯 Quick Start
-------------

[](#-quick-start)

Replace your standard queue worker command:

```
# Before
php artisan queue:work

# After
php artisan fiber:work
```

That's it! Your jobs now run concurrently using Fibers.

💡 Usage Example
---------------

[](#-usage-example)

### Standard Job (Fiber-Safe)

[](#standard-job-fiber-safe)

```
use FiberFlow\Concerns\AsyncJob;
use FiberFlow\Facades\AsyncHttp;

class ProcessWebhook implements ShouldQueue
{
    use Dispatchable, InteractsWithQueue, Queueable, AsyncJob;

    public function handle()
    {
        // This suspends the Fiber, freeing the worker for other jobs
        $response = AsyncHttp::post('https://api.stripe.com/v1/charges', [
            'amount' => 2000,
            'currency' => 'usd',
        ]);

        // Execution resumes here when the response arrives
        if ($response->successful()) {
            // Process the response...
        }
    }
}
```

### Configuration

[](#configuration)

```
// config/fiberflow.php
return [
    'max_concurrency' => 50,  // Maximum concurrent Fibers
    'memory_limit' => 256,    // MB per worker
    'timeout' => 60,          // Seconds per job
    'dashboard' => true,      // Enable TUI dashboard
];
```

🎨 TUI Dashboard
---------------

[](#-tui-dashboard)

Launch the worker with real-time monitoring:

```
php artisan fiber:work --dashboard
```

Displays:

- Active vs. suspended Fibers
- Memory usage
- Jobs/second throughput
- Queue depth

⚠️ Important Considerations
---------------------------

[](#️-important-considerations)

### ✅ Ideal Use Cases

[](#-ideal-use-cases)

- **Webhooks &amp; Notifications**: Sending thousands of HTTP requests to third-party APIs
- **Web Scraping**: Fetching data from multiple sources simultaneously
- **API Proxying**: Acting as an async middleware between services
- **Email Campaigns**: Sending bulk emails via external SMTP services

### ❌ Not Recommended For

[](#-not-recommended-for)

- **CPU-Intensive Tasks**: Image/video processing (blocks the event loop)
- **Legacy Database Operations**: Heavy Eloquent queries using blocking PDO (use async drivers or defer pattern)
- **File System Operations**: Large file reads/writes (blocking I/O)

### 🔒 Container Isolation

[](#-container-isolation)

FiberFlow uses **Container Sandboxing** to prevent state pollution between concurrent jobs. Each Fiber gets its own cloned container instance, ensuring:

- No shared singletons between jobs
- Isolated authentication state
- Safe multi-tenant operations

📚 Documentation
---------------

[](#-documentation)

- [Architecture Deep Dive](docs/ARCHITECTURE.md)
- [Roadmap](docs/ROADMAP.md)
- [Contributing Guide](CONTRIBUTING.md)
- [Changelog](CHANGELOG.md)

🧪 Testing
---------

[](#-testing)

```
composer test
```

Run tests across PHP versions:

```
composer test:coverage
```

🤝 Contributing
--------------

[](#-contributing)

Please see [CONTRIBUTING.md](CONTRIBUTING.md) for details on our code of conduct and the process for submitting pull requests.

📄 License
---------

[](#-license)

FiberFlow is open-sourced software licensed under the [MIT license](LICENSE).

🙏 Credits
---------

[](#-credits)

- Built with [Revolt PHP](https://revolt.run/) event loop
- Inspired by [AMPHP](https://amphp.org/) async primitives
- Follows [Spatie Package Standards](https://github.com/spatie/package-skeleton-laravel)

---

**Made with ❤️ for the Laravel community**

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance82

Actively maintained with recent releases

Popularity6

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity36

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.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

94d ago

### Community

Maintainers

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

---

Top Contributors

[![virgilhawkins00](https://avatars.githubusercontent.com/u/105638600?v=4)](https://github.com/virgilhawkins00 "virgilhawkins00 (42 commits)")

---

Tags

amphpasyncconcurrencycooperative-multitaskingfiberslaravelperformancephpqueuerevoltasynclaravelconcurrentperformancequeueamphprevoltfiber

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[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)
