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
We could consider adding this; if so, it would be done after the major syntax refactor implied by #281. #281 would move policy hook delegates into a fluent postfix syntax. This will make adding further policy hook delegates easier, without proliferating additional overloads.
Similarly to the comment in #336, the Polly events-for-metrics intended for Polly v6.0, should include a SucceededWithRetries event (or similar), indicating the number of retries involved in succeeding.
If that event is provided, reconsider whether the extra OnSuccess delegate hook for the retry policy discussed above is necessary.
This is similar to #383 (logging eventual failure) and #336 (logging initial attempt).
The best way for Polly to provide a solution for this would probably be to hook into a future emitted Policy event such as CompletedWithSuccess or SucceededWithRetries (which would be emitted automatically rather than extending the API surface in its current form). (cf: #336 (comment)).
Like #383, logging eventual success could also be achieved by using .ExecuteAndCapture/Async(...) overloads, perhaps using also the execution Context to capture the number of tries which have been attempted. This could be wrapped in an extension method to easily apply it to every execution, if desired.
Thanks @sudheer524 for raising this! It provides useful food for thought about cases which policy events should support.
This does feel like a strong case to support: knowing (say, on average) how many attempts were needed to achieve success.
Hi
I am trying to reuse creating policy and track the attempts and log exceptions while retry.
Is there a way to handle on success in policy itself to notify the user that call was successful in particular attempt
The text was updated successfully, but these errors were encountered: