Welcome

Welcome

Fuse is a circuit breaker for PHP 8.2+. You wrap a call that talks to another system. When that system starts failing, Fuse stops calling it for a short time, then lets a few trial calls through to see if it has recovered.

The breaker does not know about HTTP clients. You pass it a callable. Optional adapters cover Saloon connectors and Laravel applications. Each adapter is independent, so the package runs with neither, with either, or with both.

What you get

  • Three states: closed, open, and half-open.
  • A failure window, so a handful of old errors does not open the circuit forever.
  • Half-open probes, so recovery is tested with a few calls instead of a flood.
  • Pluggable storage: memory, Laravel cache, a database table, or any PSR-16 cache.
  • CircuitOpenException when a call is rejected, before your code runs.

Where to go next

You want to… Read
Install it Installation
Understand the states How it works
Call it from plain PHP Plain PHP
Use it in Laravel Laravel
Protect a Saloon connector Saloon
See every combination, end to end Scenarios

Start with How it works if the words closed, open, and half-open are new. Start with Installation if you already know circuit breakers and want the package in a project.

Edit this page