Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Liveness probes #9

Open
nicolabovolato opened this issue Feb 29, 2024 · 2 comments
Open

Liveness probes #9

nicolabovolato opened this issue Feb 29, 2024 · 2 comments

Comments

@nicolabovolato
Copy link

Hi and thank you for this much needed library.

Have you considered, or are you planning to add, a way to drivers are able to communicate properly?
I'm thinking about exposing a function to ping redis or select 1 a database.

It would be great to have such functionality available on the BentoCache instance, to be called when needed or exposed by an http route.

@Julien-R44
Copy link
Owner

hey, thanks !

i am not sure if that's the role of the library to do that

when you create your Bentocache instance, you must pass your ioredis instance, for example. so you can keep this instance around and use it for your route + health check. so yeah, nothing stops you from doing this without bentocache exposing this functionality. It just seems a bit out of scope to me

and also, there are drivers for which it wouldn't make sense to have this, like filesystem and in-memory.

let me know what you think

@nicolabovolato
Copy link
Author

I agree with you that if a library like bentocache provides one with the ability to supply his own (redis or whatsoever) instances there should be no need to implement healthchecks. Still I think that given the aim of bentocache, a built in healthcheck would be nice!

Moreover, I don't see this capability with redis' bus driver, as in the constructor you can only provide ioredis options.
I could always wrap or extend the driver class if it wasn't that (and rightly so) underlying instances are private members.

As for memory or fs drivers, I still think that a healthcheck can [1] [2] be implemented, even if that may not make sense for common workloads. Also, testing won't be trivial.

With that being said, I still think it would be a nice feature but perhaps not as valuable as it is to me for other users.
Up to you! I would be happy to submit a pr should ever change your mind.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants