-
-
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
[Docs] Fix the policywrap sample #1728
[Docs] Fix the policywrap sample #1728
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1728 +/- ##
=======================================
Coverage 84.56% 84.56%
=======================================
Files 307 307
Lines 6790 6790
Branches 1043 1043
=======================================
Hits 5742 5742
Misses 839 839
Partials 209 209
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
@martintmk In case of V8 the FIFO statement is incorrect IMHO. The firstly added strategy will be executed last. So, first you define the outer most and last the inner most. Which is the same order as in case of V7 (first parameter is the outer most, last parameter is the inner most). If you agree then I will update this section to reflect the current behavior. Dotnet fiddle: https://dotnetfiddle.net/znmcPA |
6340a65
to
4daee53
Compare
They problem is relying on the callback events, what's important is the when retry strategy starts executing and when it ends. Yes, it's true that the timeout event is reported first, but at that point the retry strategy is already executing. If you put custom strategy that just reports events before and after the callback is executed, it would become clear. |
Sorry @martintmk , but I'm a bit lost. Could you please rephrase your statement? (I'm not sure I understand it 100%). |
I believe this test conveys what I am trying to say. It adds multiple strategies to the pipeline and asserts the order of execution:
|
I understand that
I think I get it what do you want to describe. Forgot the var retryPolicy = Policy.Handle<Exception>().WaitAndRetryAsync(2, _ => TimeSpan.FromSeconds(0.5));
var timeoutPolicy = Policy.TimeoutAsync(TimeSpan.FromSeconds(1));
var wrappedPolicy = Policy.WrapAsync(retryPolicy, timeoutPolicy);
Console.WriteLine("Outer: " + wrappedPolicy.Outer.GetType().Name);
Console.WriteLine("Inner: " + wrappedPolicy.Inner.GetType().Name); and the output:
are you convinced ? |
Pull Request
The issue or feature being addressed
Details on the issue fix or feature implementation
Confirm the following