You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be useful to have an on_attempt callback which was called before every invocation of the decorated function - seems like that would complete the callback suite :)
My use-case is updating some state (i.e. "connecting" / "waiting" / "connected") that it's not practical to modify from inside my decorated function. if I wasn't using backoff, I would update the state immediately before and after calling my connect function.
I can make a PR if there's support for this idea!
The text was updated successfully, but these errors were encountered:
I think to be consistent with other names like max_tries and tries we should probably call it on_try. (I think I might like the name on_attempt better for what it's worth.)
The PR above still needs a little love before I'd be ready to merge but if you want to test it out in the meantime, please do.
I'm also a bit curious about the use case you mentioned. Do you have a code sample of it? Do you think it is something that would be worth adding as an example to the backoff docs?
It would be useful to have an
on_attempt
callback which was called before every invocation of the decorated function - seems like that would complete the callback suite :)My use-case is updating some state (i.e. "connecting" / "waiting" / "connected") that it's not practical to modify from inside my decorated function. if I wasn't using backoff, I would update the state immediately before and after calling my connect function.
I can make a PR if there's support for this idea!
The text was updated successfully, but these errors were encountered: