- Sponsor
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Passing exception and retry count to execution (general: pass mutable data between onRetry and Execute) #38
Comments
After some more experimenting with the library, I want to try to be more accurate. What I want to do is this:
Currently the way I'm doing it is something like this:
This seems a bit cumbersome. Is there a better way to do that? |
Any news on this? |
@YoniH @hawkunsh An AppvNext team has taken over stewardship of Polly, and are now looking at historic issues such as this. I'll comment in case still useful to you or others. The The general case of your request would be a mechanism within Polly for passing mutable data between control delegates (such as @YoniH asked if there was any better way to do this than the example presented. My only observation is that, as the example already implicitly closes over
Hope that this helps. We'll leave this issue open, as a general prompt of the possibility to pass mutable data between onRetry and Execute. Others interested, please +1 if this is an important feature for you |
The ability to do this is now delivered in Polly v5.1. Polly's See http://www.thepollyproject.org/2017/05/04/putting-the-context-into-polly/ for details. Shout if any questions/suggestions. |
Hi,
In policy execution, I need to access the retry number and the exception that was thrown.
I managed to do this only with class members, as in this console app:
However, is there a way to do this only with Polly, without class members?
The text was updated successfully, but these errors were encountered: