npm.io
0.0.3 • Published 10 years ago

hiot-circuit-breaker

Licence
MIT
Version
0.0.3
Deps
1
Vulns
0
Weekly
0
DeprecatedThis package is deprecated

hiot-circuit-breaker

A promisified version of circuit-breaker-js

Usage

For options and default values, see https://github.com/yammer/circuit-breaker-js/blob/master/README.md.

var CircuitBreaker = require('hiot-circuit-breaker');

var breaker = new CircuitBreaker(/* options */);

var command = fetch('http://another-api.com/stuff');
var fallback = Promise.resolve('no stuff');

breaker.run(command, fallback)
  .then(x => console.log(x));

Keywords