2017 © Pedro Peláez
 

bundle php-circuit-breaker-bundle

Circuit breaker to symfony

image

lemonde/php-circuit-breaker-bundle

Circuit breaker to symfony

  • Tuesday, June 6, 2017
  • by CaptainJojo
  • Repository
  • 24 Watchers
  • 9 Stars
  • 543 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 5 Versions
  • 9 % Grown

The README.md

php-circuit-breaker-bundle

Build Status Build Status Scrutinizer Code Quality Code Coverage, (*1)

Description

Everything is MIT licensed and unsupported unless otherwise stated. Use at your own risk., (*2)

Implement circuit breaker pattern see here http://martinfowler.com/bliki/CircuitBreaker.html., (*3)

You can find explanation in french here https://medium.com/eleven-labs/le-circuit-breaker-k%C3%A9sako-4763e13a4a03, (*4)

How to install ?

Requirements

  • >=PHP 7
  • use LoggerInterface
  • use CacheInterface
composer require lemonde/php-circuit-breaker-bundle:lastest

Add in your AppKernel.php, (*5)

public function registerBundles()
    {
        $bundles = [
            ....
            new CircuitBreakerBundle\CircuitBreakerBundle(),
        ];

        return $bundles;
    }

Add in your config.yml, (*6)

circuit_breaker:
    # Number fail possible in circuit breaker
    threshold: 5
    # Time in seconds resend call after circuit breaker is open
    timeout: 20

And add config to CacheInterface in your config.yml, (*7)

framework:
    cache:
        app: cache.adapter.filesystem

How to use ?

Before your service's call, (*8)

if ($this->get('circuit.breaker')->isOpen('your-service')) {
    // If service is down
}

You need to send status on service to each call, (*9)

// $status is bool
$this->get('dispatcher')->dispatch('circuit.breaker', new CircuitBreakerEvent('your-service', $status));

How to contribute ?

You can add issue, and create pull request. https://github.com/lemonde/php-circuit-breaker-bundle/blob/master/.github/CONTRIBUTING.md, (*10)

The Versions

06/06 2017

dev-master

9999999-dev

Circuit breaker to symfony

  Sources   Download

MIT

The Requires

 

The Development Requires

06/06 2017

1.1.1

1.1.1.0

Circuit breaker to symfony

  Sources   Download

MIT

The Requires

 

The Development Requires

21/03 2017

1.1.0

1.1.0.0

Circuit breaker to symfony

  Sources   Download

MIT

The Requires

 

The Development Requires

06/03 2017

1.0.1

1.0.1.0

Circuit breaker to symfony

  Sources   Download

MIT

The Requires

 

The Development Requires

28/12 2016

1.0.0

1.0.0.0

Circuit breaker to symfony

  Sources   Download

MIT

The Requires

 

The Development Requires