• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

bucharest-gold / opossum / 327
100%

Build:
DEFAULT BRANCH: master
Ran 22 Jun 2017 04:01PM UTC
Jobs 3
Files 7
Run time 21s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

pending completion
327

push

travis-ci

web-flow
feat: Add health check function to a circuit breaker (#76)

## Add `circuit.healthCheck(func[, interval])`

Exposes a way for users to provide their own health check function. The provided function
should return a promise. If the promise is rejected, the circuit will open and the `health-check-failed` event will be emitted.

## Usage
```js
const circuit = opossum(myFunction);
circuit.healthCheck(_ => {
    // check the status of the remote service
    if (remoteServiceDown) {
       return Promise.reject('Cannot connect to remote service');
    }
    return Promise.resolve();
  }, 10000); // check interval - default is 5000

circuit.on('health-check-failed', (err) => {
  // send a text message to the poor sysadmin
  sendErrorText(err);
});
```

106 of 116 branches covered (91.38%)

11 of 11 new or added lines in 1 file covered. (100.0%)

329 of 331 relevant lines covered (99.4%)

827.97 hits per line

Jobs
ID Job ID Ran Files Coverage
1 327.1 22 Jun 2017 04:01PM UTC 0
99.4
Travis Job 327.1
2 327.2 22 Jun 2017 04:01PM UTC 0
99.4
Travis Job 327.2
3 327.3 22 Jun 2017 04:01PM UTC 0
99.4
Travis Job 327.3
Source Files on build 327
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #327
  • 0e39faa1 on github
  • Prev Build on master (#326)
  • Next Build on master (#332)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc