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
I want to decorate methods of a class with @Retry and use a specific method as the "retry_on_exception" function. Issue is of course, that you can not do
@retry(retry_on_exception=self.retry_handler)
since self is not defined in that case. This code snippet is an attempt to work around this:
*dargs would have to be modified similarly to kwargs. There might be an even more elegant solution though. But this is the best I could come up with so far.
I want to decorate methods of a class with @Retry and use a specific method as the "retry_on_exception" function. Issue is of course, that you can not do
@retry(retry_on_exception=self.retry_handler)
since self is not defined in that case. This code snippet is an attempt to work around this:
*dargs would have to be modified similarly to kwargs. There might be an even more elegant solution though. But this is the best I could come up with so far.
This seems to work, although you can not do
since MyClass is not defined at that point yet.
so you have to do
which is quite annoying.
Would be cool if anyone had a better idea.
The text was updated successfully, but these errors were encountered: