service-breaker
Circuit breaker for calling another services
Install
$ npm install service-breaker
Usage
const ServiceBreaker = const config = services: 'transaction' 'auth' const serviceBreaker = config timeoutDuration: 50000 // default 100000 maxFailures: 5 // default 10 serviceBreaker serviceBreaker serviceBreaker { console} { console}
API
new ServiceBreaker
ServiceBreaker([config, timeoutDuration, maxFailures])
invoke
serviceBreaker.invoke([execute, fallback], serviceName, callback)
callback is optional, callback parameter is an error.
License
MIT @Aldi Priya Perdana