ejsmont-artur / php-circuit-breaker Goto Github PK
View Code? Open in Web Editor NEWPHP implementation of circuit breaker pattern.
License: MIT License
PHP implementation of circuit breaker pattern.
License: MIT License
Is there a specific reason why there is no mysql storage adapter? I would like to have a central point where all webservers could store and retrieve their circuit breaker information instead of having it local.
I noticed another package not supporting this out of the box as well so am curious if this is a bad idea or not.
/**
namespace Ejsmont\CircuitBreaker\Storage\Decorator;
use Ejsmont\CircuitBreaker\Storage\StorageInterface;
/**
namespace Ejsmont\CircuitBreaker\Storage\Decorator;
use Ejsmont\CircuitBreaker\Storage\StorageInterface;
use Ejsmont\CircuitBreaker\Storage\StorageException;
The interface for storage:
https://github.com/ejsmont-artur/php-circuit-breaker/blob/master/src/Ejsmont/CircuitBreaker/Storage/StorageInterface.php
seems not to support atomic operations. Multiple processes on the same machine can interleave like:
1. load value X
2. load value X
1. store value X+1
2. store value X+1
so that X+1 is stored instead of X+2 due to this race condition. Are you aware of this? I was planning to integrate a MongoDB storage but with this interface it won't solve the problem.
Hello,
I had an issue with your project. The isAvailable
should remove failures but it reset the time and keep failures. That looks wrong. I guess there is a typo here:
https://github.com/ejsmont-artur/php-circuit-breaker/blob/master/src%2FEjsmont%2FCircuitBreaker%2FCore%2FCircuitBreaker.php#L155
$this->setFailures($serviceName, $failures);
should be
$this->setFailures($serviceName, 0);
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.