Skip to content
This repository was archived by the owner on Aug 8, 2025. It is now read-only.
This repository was archived by the owner on Aug 8, 2025. It is now read-only.

How to provide arguments to on_backoff function #208

@vk496

Description

@vk496

Hello and thank you for this amazing project.

Im experimenting with it and I miss be able to use arguments to the backoff functions. For example:

async def backoff_f(arg1: int):
  pass

@backoff.on_exception(wait_gen=backoff.expo, exception=ValueError, on_backoff=backoff_f(arg1=2), max_tries=5)
@backoff.on_exception(wait_gen=backoff.expo, exception=RuntimeError, on_backoff=backoff_f(arg1=6), max_tries=5)
async def test1() -> int:
  pass

Is that possible?

Thank you in advance

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions