{"push_id":901971194,"size":1,"distinct_size":1,"ref":"refs/heads/master","head":"ac659b8ff697315bc4440de27568e2df5707a876","before":"4d2bdc63511e3680b2e9898515d66d6bf3a764c0","commits":[{"sha":"ac659b8ff697315bc4440de27568e2df5707a876","author":{"email":"b60b43aa978fa0358169da7e0138b3afeb52088e@spicefactory.org","name":"Jens Halm"},"message":"Refactoring for thread-safety and reduction of complexity\n\nThe original behaviour is retained, but the implementation, apart from \nkeeping the state pattern, has the following significant changes:\n\n* Stop using atomics as the combined use of closely related atomics is \nnot thread-safe. It led to non-deterministic behaviour, in particular a \nstate could execute its logic without being the current state anymore.\n  \n* Reduce mutability, from 5 mutable fields to 2, through remodeling the \nstates.\n\n* Introduce a 4th state (`UnstableState`), to avoid having to manually \ndeal with `turbulenceStartedAt` timings etc.\n  \n* Rename `UnhealthyState` to `UnavailableState` to avoid confusing it \nwith the new `UnstableState`. \n  \n* Move all state and behaviour only needed in one of the states to the \ncorresponding state implementation.\n\n* Introduce `CountingState` and `TimedState` traits to avoid duplicate \nlogic.\n  \n* Move separate `Executor` and states into `CircuitBreaker` \nimplementation as its reduction in size made the separation obsolete \n(which also removes the indirection to talk through a \n`CircuitBreakerModel`).\n  \n* Remove the Registry. It was not thread-safe either and there does not \nseem to be any benefit to organizing `CircuitBreaker`s in a registry.\n  \n* `UnavailableState` does no longer throw an Exception in its \n`processResult` method. Due to the asynchronous nature of the circuit \nbreaker, this can happen any time.\n\n* Introduce `CircuitBreakerConfig` case class to avoid the need to pass \nall configuration values around individually.\n  \n* Introduce a custom predicate (`Throwable => Boolean`) to tell the \n`CircuitBreaker` which exceptions are expected results (e.g. a 404 for a \nlookup) and should not be treated as a failure.","distinct":true,"url":"https://api.github.com/repos/jenshalm/reactive-circuit-breaker/commits/ac659b8ff697315bc4440de27568e2df5707a876"}]}