Implementation of the Circuit Breaker pattern for Guzzle that prevents sending failed requests in a row.
composer require dronezzzko/guzzle-simple-circuit-breaker
use GuzzleHttp\HandlerStack;
use GuzzleHttp\Handler\CurlHandler;
use GuzzleHttp\Client;
use Dronezzzko\SimpleCircuitBreakerMiddleware;
$stack = HandlerStack::create();
$stack->push(SimpleCircuitBreakerMiddleware::factory($cache));
$client = new Client(['handler' => $stack]);