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

Feature Request: Consider using tenacity for retrying logic #43

Open
Skeen opened this issue Jul 21, 2021 · 1 comment
Open

Feature Request: Consider using tenacity for retrying logic #43

Skeen opened this issue Jul 21, 2021 · 1 comment
Labels
good first issue Good for newcomers

Comments

@Skeen
Copy link

Skeen commented Jul 21, 2021

Hello,

I don't know which considerations were applied when this library was designed, and whether keeping dependencies to an absolute minimal is a requirement, but if this is not the case, would it be worth considering utilizing https://github.com/jd/tenacity for the retrying logic, rather than implementing it from scratch?

If such an approach was taken, this library would essentially minimize itself to solely gluing tenacity and aiohttp together, and it would enable using all retrying options from tenacity rather than the subset which is available here.

@inyutin inyutin added the good first issue Good for newcomers label Aug 5, 2022
@inyutin
Copy link
Owner

inyutin commented Aug 5, 2022

@Skeen hello!

This project grew out of a little piece of code we needed at work a long time ago. I didn't know about tenacity at the time and it was easier for me to write a wrapper than to adapt solutions for retries. Moreover I'm still don't know anything about them. Moreover, I still know nothing about tenacity and I'm don't use it.

Personally I think that libraries should be quite wide in their api. It's a good think that aiohttp_retry provide it's own way to define retry logic. I'm sure that this api is good and straightforward and suites most of the needs. On the hand, I'm agree that the library should be easily adopted by the solutions of other libraries. In other terms I'm sure it will be great to have a bridge between aiohttp_retry and tenactiy.

To be honest I don't want to invest my time into understating how tenacity works and it's api. I will be glad if someone will open a good PR to implement tenacity behaviour in aiohttp_retry. The way I see it is that it should be a special RetryOptions class for that. This class should receive a tenacity object, that defines retries, and then implement get_timeout function with the using of this function.

I will be appreciate if someone would do such a thing.

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

No branches or pull requests

2 participants