Questions tagged [polly]

Polly is a .NET resilience and transient-fault-handling library that allows developers to express policies such as Retry, Circuit Breaker, Timeout, Bulkhead Isolation, and Fallback in a fluent and thread-safe manner. Polly targets .NET Standard 1.1 and .NET Standard 2.0.

Polly is a .NET resilience and transient-fault-handling library that allows developers to express policies such as Retry, Circuit Breaker, Timeout, Bulkhead Isolation, and Fallback in a fluent and thread-safe manner. Polly targets .NET Standard 1.1 and 2.0+. For further information read Polly's wiki.

454 questions
-1
votes
1 answer

C# Polly with pessimistic timeout strategy slow on multiple threads?

Consider this piece of code: using System; using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; using Polly; using Polly.Timeout; namespace Test { public class Program { public static async Task…
picusiaubas
  • 115
  • 2
  • 9
-1
votes
1 answer

Polly ExecuteAndCaptureAsync not throwing exceptions when circuit breaker is open

I have the following code: var policyResult = await _circuitBreakerPolicy.ExecuteAndCaptureAsync(async () => { return await configuredTaskAwaitable; }); return policyResult.Result; When the circuit breaker is in Open state,…
ryudice
  • 36,476
  • 32
  • 115
  • 163
-1
votes
2 answers

Specify Giveup/Failure Action

I am using Polly to make HTTP requests and retry 5 attempts if the request fails. Is it possible to specify an action when 5 attempts have failed and the policy gives up? In the below code; when we have failed 5 times I know the user doesn't have…
sazr
  • 24,984
  • 66
  • 194
  • 362
-2
votes
1 answer

RestEase with Polly refresh token doesn't work

really need some help to understand what I'm doing wrong with my reauthorization policy. My policy looks like this: var policy = Policy .HandleResult(message => message.StatusCode == HttpStatusCode.Unauthorized) …
Scott
  • 19
  • 6
1 2 3
30
31