https://github.com/scality/breakbeat
https://github.com/scality/breakbeat
artesca zenko
Last synced: 8 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/scality/breakbeat
- Owner: scality
- License: apache-2.0
- Created: 2022-11-18T08:02:13.000Z (over 3 years ago)
- Default Branch: development/1.0
- Last Pushed: 2024-07-05T14:12:31.000Z (almost 2 years ago)
- Last Synced: 2025-11-15T07:39:18.282Z (7 months ago)
- Topics: artesca, zenko
- Language: TypeScript
- Homepage:
- Size: 155 KB
- Stars: 1
- Watchers: 27
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# breakbeat

## About
Rule based stop and go.
## Examples
```typescript
const { CircuitBreaker, BreakerState } = require('breakbeat');
const conf = {
probes: [],
nominalEvaluateIntervalMs: 30000,
stabilizeAfterNSuccesses: 2,
};
const b = new CircuitBreaker(conf);
b.start();
const i = setInterval(() => {
if (b.state === BreakerState.Nominal) {
console.log('all good, proceeding');
} else {
console.log('issue detected, delaying work');
}
}, 5000);
process.on('beforeExit', (code) => {
clearInterval(i);
b.stop();
});
```