How to use Flurl with Polly without factory

爷,独闯天下 提交于 2019-12-25 01:48:31

问题


Following from Set a default Polly policy with Flurl

How do I use Polly with Flurl without the factory? This only calls it once

string s = await Policy
                        .Handle<HttpRequestException> ()
                        .OrResult <HttpResponseMessage> (r => !r.IsSuccessStatusCode)
                        .RetryAsync (5)
                        .ExecuteAsync (() => { Console.WriteLine ("Retry"); return "http://127.0.0:7071/".GetAsync (); })
                        .ReceiveString ()
                        .ConfigureAwait (false);

来源:https://stackoverflow.com/questions/55718410/how-to-use-flurl-with-polly-without-factory

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!