PHPackages                             lucifer07/fuse - 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. lucifer07/fuse

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

lucifer07/fuse
==============

Circuit breaker for Laravel queue jobs. PHP 8.1 compatible.

00PHP

Since Feb 4Pushed 3mo agoCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

Fuse - Circuit Breaker for Laravel Queue Jobs
=============================================

[](#fuse---circuit-breaker-for-laravel-queue-jobs)

Circuit breaker pattern implementation for Laravel queue jobs. PHP 8.1+ compatible.

Features
--------

[](#features)

- **Three-State Circuit Breaker** — CLOSED (normal), OPEN (protected), HALF-OPEN (testing recovery)
- **Intelligent Failure Classification** — Rate limits (429) and auth errors (401, 403) don't trip the circuit
- **Peak Hours Support** — Different thresholds for business hours vs. off-peak
- **Fixed Window Tracking** — Minute-based buckets with automatic expiration
- **Thundering Herd Prevention** — `Cache::lock()` ensures only one worker probes during recovery
- **Zero Data Loss** — Jobs are delayed with `release()`, not failed permanently
- **Automatic Recovery** — Circuit tests and heals itself when services return
- **Per-Service Circuits** — Separate breakers for each service
- **Laravel Events** — Get notified on state transitions for alerting and monitoring

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

[](#requirements)

- PHP 8.1+
- Laravel 10+
- Redis (recommended) or any Laravel cache driver

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

[](#installation)

```
composer require lucifer07/fuse
```

Publish the configuration:

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

Quick Start
-----------

[](#quick-start)

Add the middleware to your job:

```
