Open rudolfbyker opened 3 months ago
Hi @rudolfbyker, thank you for the issue.
At this point, this library is in maintenance mode. I am not actively using healthchecks.io anymore in my workflow, so I am no longer using their API daily. I will review PRs if you are interested in contributing.
I am not a big fan of adding retries to the library itself. I would leave that to the user. Could you wrap calls to success_ping or fail_ping in a retry wrapper in your code? They both raise unique exceptions you could use to control the retry behavior. You could also catch the exceptions in your script for when your internet is down and not fail there.
I think the pluggable backend is the best route to go if you want to contribute.
At first I wrote my own simple client for healthchecks.io with just the minimal features that I need, but then I thought, someone must have done this already, so I searched and found your project. It's very clean and easy to understand, so well done.
Is your feature request related to a problem? Please describe.
My client does two things which I'm missing in yours, which is preventing me from throwing away mine and just using yours:
requests.request
function in atenacity.retry
decorator for all requests that are safe to retry (basically all of the ping API and some of the management API).Describe the solution you'd like
There are a few possible options:
request
back end pluggable – instead of this client prescribing the use ofhttpx
. This can be done with proper typing by defining aProtocol
with a__call__
method stub.httpx
, but wrap some calls in retries usingtenacity
AND add a flag to the client contructor and/or to specific methods to ignore all errors.Describe alternatives you've considered
check_response
andcheck_ping_response
methods of your client. :/Additional context
N/A