Skip to content

Add __aexit__and __aenter__ to AttemptManager #469

@notypecheck

Description

@notypecheck

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_

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions