Skip to content

Retry for Synchronous Generator #64

@heri16

Description

@heri16

Could we support retry for Synchronous Generator?

import random
from tenacity import retry

@retry
def ticker(to):
    """Yield numbers from 0 to `to`."""
    for i in range(to):
        if random.randint(0, 10) > 1:
            raise IOError("Broken sauce, everything is hosed!!!111one")
        else:
            yield i

for i in ticker(10):
    print(i)

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