https://github.com/a179346/rxjs-probe
rxjs-probe provides an interface similar to Kubernetes probes using RxJS to detect service health.
https://github.com/a179346/rxjs-probe
browser health-check node probe rxjs rxjs-observables ts typescript
Last synced: 2 months ago
JSON representation
rxjs-probe provides an interface similar to Kubernetes probes using RxJS to detect service health.
- Host: GitHub
- URL: https://github.com/a179346/rxjs-probe
- Owner: a179346
- License: mit
- Created: 2024-09-16T09:37:57.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2024-09-23T13:19:45.000Z (8 months ago)
- Last Synced: 2025-03-11T03:37:59.258Z (2 months ago)
- Topics: browser, health-check, node, probe, rxjs, rxjs-observables, ts, typescript
- Language: TypeScript
- Homepage: https://github.com/a179346/rxjs-probe
- Size: 166 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
> rxjs-probe provides an interface similar to [Kubernetes probes](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/) using [RxJS](https://rxjs.dev/) to detect service health.
## 🔗 Link
- [Github](https://github.com/a179346/rxjs-probe)
- [npm](https://www.npmjs.com/package/@rxjs-probe/core)## 📥 Install
```sh
npm i rxjs @rxjs-probe/core
```## 🔑 Usage
```ts
import { Probe, ProbePerformer } from '@rxjs-probe/core';
import axios from 'axios';const probe = new Probe({
performer: new ProbePerformer(async timeoutSeconds => {
await axios({
url: 'https://github.com/a179346/rxjs-probe',
timeout: timeoutSeconds * 1000,
validateStatus: status => status === 200,
});
}),
initialDelaySeconds: 3,
periodSeconds: 2,
timeoutSeconds: 1,
successThreshold: 1,
failureThreshold: 3,
});const probeObservable = probe.createObservable();
```probeObservable is an RxJS Observable. You can subscribe to it to get the probe status.
Check the [RxJS documentation - Observable](https://rxjs.dev/guide/observable) for more information.
## 📖 Examples
You can find more examples on how to use rxjs-probe in [rxjs-probe-examples GitHub repository](https://github.com/a179346/rxjs-probe-examples).
## 🔎 Probe Performers
- [Probe Performer](https://github.com/a179346/rxjs-probe-examples/tree/main?tab=readme-ov-file#-custom-probe-performer) - The customizable health check performer
- [Http Probe Performer](https://github.com/a179346/rxjs-probe/tree/main/packages/http-probe-performer#readme) - Sending HTTP GET requests to perform the health check.## 🤝 Contributing
Contributions, issues and feature requests are welcome!
Feel free to check [issues page](https://github.com/a179346/rxjs-probe/issues).## 🌟 Show your support
Give a ⭐️ if this project helped you!
## 📝 License
Copyright © 2024 [a179346](https://github.com/a179346).
This project is [MIT](https://github.com/a179346/rxjs-probe/blob/main/LICENSE) licensed.---
_This README was generated with ❤️ by [readme-md-generator](https://github.com/kefranabg/readme-md-generator)_