[Question]: documentation
What are you wanting to achieve?
apparently your are so fast with developing that there is no documentation about how to integrate the latest versions into Flurl or Refit.
To be honest, I do understand a lot of the library but I can't figure it out how to incorporate it with a HttpClient-call or so. It is probably my misunderstanding and lack of compentencies to figure it out.
But, I do not want to handle bare http clients in my libraries, so that is why I use Refit but adding the functions of Polly is super valuable to make libraries robust. So for today, I will end up by implementing my own retry-function.
What code or approach do you have so far?
i have no clue where to start
Additional context
No response
As long as we don't get too "kitchen-sink-y" I think it would be reasonable to contain some minimal examples of how to use Polly with some popular other libraries.
Until then, this code in a sandbox app of mine might prove helpful to you regarding Refit: RefitHttpClientBuilderExtensions.
In essence, Polly is integrated into HttpClient via HttpClientFactory, and then Refit is integrated into HttpClientFactory.
At the end of March or beginning of April, I can start working on this. @martincostello you can assign this ticket to me.
I was thinking to create sample codes (with reference links) to the followings:
- HttpClient
- RestSharp
- Flurl
- Refit
- (Kiota)
What do you guys think? Is it enough / too much ?
Let's start with HttpClient and Refit (purely as those are the two I'm most familiar with 😄) and then go from there.
@MannusEtten Could you please check this documentation page? Does it address your concerns? If so, could you please close this issue?
@peter-csala i am not 100% sure to be honest, maybe i just understand polly not well enough either. I do really like the APIResponse part of Refit because we can check without getting exceptions the status of the response.
We do not use everywhere the DI-container so the example is based on the DI-container. Besides that we do have not always the same retyr-policies in place.
So I would say, thanks for the effort. I will just build my own solution. It is too complicated with Polly right now and I have to make progress in my project.
Hey @MannusEtten, I was on holiday last week so, apologize for the late response.
In case of Polly you can decorate a HTTP network call with resilience behavior either explicitly or implicitly. The explicit means that you have a reference to a ResiliencePipeline and you call one of the Execute{Aync} overloads. You can create a new ResiliencePipeline every time when you make a HTTP call or you can create it once and use it many times by utilizing the ResiliencePipelineRegistry.
The implicit means that you have registered a HTTP client into a DI container, and you decorate the client with some resilience behavior. Then whenever you make a HTTP call through the client, the resilience pipeline is executed on your behalf inside a special DelegatingHandler called ResilienceHandler.
The later approach was demonstrated on the above mentioned documentation page.
This issue is stale because it has been open for 60 days with no activity. It will be automatically closed in 14 days if no further updates are made.
This issue was closed because it has been inactive for 14 days since being marked as stale.