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

Add __aexit__and __aenter__ to AttemptManager #469

Open
ThirVondukr opened this issue Jun 13, 2024 · 0 comments
Open

Add __aexit__and __aenter__ to AttemptManager #469

ThirVondukr opened this issue Jun 13, 2024 · 0 comments

Comments

@ThirVondukr
Copy link

AttemptManager currently doesn't support async context manager protocol, requiring nesting two times instead of one if you want to use an async context manager with retrying:

async for attempt in retrying:
    with retrying:
        async with ratelimit:
            ...

Because AttemptManager doesn't do any IO I think it should be ok to just call into sync __enter__ and __exit_

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