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

README: max_value arg to @backoff.on_predicate(backoff.fibo...) -- if not obsolete, then maybe just confusing? #213

Open
reed9999 opened this issue Feb 13, 2024 · 0 comments

Comments

@reed9999
Copy link

reed9999 commented Feb 13, 2024

As a first-time user of backoff I tried decorating with a slight variation of the example in the README:

@backoff.on_predicate(backoff.fibo, lambda x: x != "SUCCEEDED", max_value=13)

My decorated function, a stub that would always fail, kept getting retried in an endless loop. From the source for _on_predicate it sure appears to want max_tries or max_time instead.

And I am willing to put in a PR, except that the text of the README sounds like this isn't an accident:

Extra keyword arguments are passed when initializing the wait generator, so the max_value param above is passed as a keyword arg when initializing the fibo generator.

Well, I see the fibo generator in the code wants max_value, but it didn't work for me out of the box. I didn't debug far enough to see if it gets passed through, but it didn't seem to stop execution for several minutes.

In any event this feature seems to require some additional understanding to be used out of the box. Would it be valuable to demonstrate simpler uses of fibo to start (with max_tries and max_time) and then, as appropriate, build up to this trickier (at least for me) usage?

@reed9999 reed9999 changed the title README: max_value arg to `@backoff.on_predicate(backoff.fibo...) -- if not obsolete, then maybe just confusing? README: max_value arg to @backoff.on_predicate(backoff.fibo...) -- if not obsolete, then maybe just confusing? Feb 13, 2024
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

1 participant