PHPackages                             holidaypirates/pirate-circuit-breaker - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. holidaypirates/pirate-circuit-breaker

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

holidaypirates/pirate-circuit-breaker
=====================================

Implementation of the 2-state CircuitBreaker pattern that we use at HolidayPirates

v1.0.0(6y ago)63.5k[2 PRs](https://github.com/holidaypirates/pirate-circuit-breaker/pulls)MITPHPPHP &gt;=7.3

Since Jul 18Pushed 5y ago1 watchersCompare

[ Source](https://github.com/holidaypirates/pirate-circuit-breaker)[ Packagist](https://packagist.org/packages/holidaypirates/pirate-circuit-breaker)[ Docs](https://www.holidaypirates.group)[ RSS](/packages/holidaypirates-pirate-circuit-breaker/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (1)Dependencies (5)Versions (6)Used By (0)

pirate-circuit-breaker
======================

[](#pirate-circuit-breaker)

[![Codacy Badge](https://camo.githubusercontent.com/779dab132801f0fca610aabc1c527691f5c38d43216d3d2d15b65d4cd8517fcd/68747470733a2f2f6170692e636f646163792e636f6d2f70726f6a6563742f62616467652f47726164652f6636666633323635353033373436616238323465396532646638343537306636)](https://app.codacy.com/app/ricardofiorani/pirate-circuit-breaker?utm_source=github.com&utm_medium=referral&utm_content=holidaypirates/pirate-circuit-breaker&utm_campaign=Badge_Grade_Dashboard)[![Quality Score](https://camo.githubusercontent.com/eeb1f69faee94b5d513851d3b13e01b8600fbb0054783155923acb55608d7407/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f686f6c69646179706972617465732f7069726174652d636972637569742d627265616b65722e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/holidaypirates/pirate-circuit-breaker)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/2b2b7f64a90a7675c70ca946c29a1a1dead86fb068f3dc60f159ac4b70b1d79e/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f686f6c69646179706972617465732f7069726174652d636972637569742d627265616b65722f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/holidaypirates/pirate-circuit-breaker)

This is an Implementation of the 2-state (Open and Closed) CircuitBreaker pattern that we use at HolidayPirates.
Unlike the [3-state CircuitBreaker proposed by Fowler](https://martinfowler.com/bliki/CircuitBreaker.html), this implementation has only two states, "Open" and "Closed".

Install
-------

[](#install)

Via Composer

```
$ composer require holidaypirates/pirate-circuit-breaker
```

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

[](#requirements)

- PHP 7.3
- An implementation of the `\Psr\SimpleCache\CacheInterface` to store the services failures and circuit state OR your own storage implementation of `\HolidayPirates\CircuitBreaker\Storage\StorageInterface`
- For development only : Docker and Docker-Compose

Usage
-----

[](#usage)

```
