An open API service indexing awesome lists of open source software.

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.

Awesome Lists containing this project

README

        


✨ rxjs-probe ✨



Documentation


Documentation


Documentation


Maintenance


License: MIT


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