hiot-circuit-breaker

0.0.3 • Public • Published

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));

Package Sidebar

Install

npm i hiot-circuit-breaker

Weekly Downloads

1

Version

0.0.3

License

MIT

Last publish

Collaborators

  • dewe