Releases: nodeshift/opossum
Releases · nodeshift/opossum
Adds CircuitBreaker#call() method
This allows the user to control the this
context within the function execution for a circuit. This method behaves in many ways like Function.prototype.call()
. It takes a this
context as the first parameter and any optional parameters as an argument list to the function. Here is an example usage:
const context = {
lunch: 'sushi'
};
async function getLunch (param) {
return param
? Promise.resolve(param)
: Promise.resolve(this.lunch);
}
getLunch.lunch = 'tacos';
const circuit = new CircuitBreaker(getLunch);
circuit.call()
.then(console.log) // logs 'tacos'
.then(_ => {
circuit.call(context)
.then(console.log) // logs 'sushi'
.then(_ => {
circuit.call(context, 'burgers')
.then(console.log); // logs 'burgers'
});
});
Extract metrics and remove factory function
4.0.0 (2019-08-21)
Breaking Changes
- The factory function has been removed in favor of simply using the
CircuitBreaker
constructor. - Prometheus and Hystrix metrics have been moved into their own repositories.
- We no longer keep a set of all circuits
DO NOT USE
Breaking changes were unintentionally pushed as a minor version release. Please either stick with 3.0.0 or bump to 4.0.0.
Version 3.0.0
Active Circuit Iterator
Prometheus Options and Browser Love
Prometheus improvements
Prometheus integration
Hystrix Deprecation
Hystrix is now deprecated. We will soon be doing a major version bump to 2.0.0 adding Prometheus metrics, and changing some of the event names.