Difference of async lambda and simple lambda in Polly

32 Views Asked by At
var retry1 = Policy.Handle<Exception>().RetryAsync(onRetryAsync: (exception, i) => OnRetryAsync());
var retry2 = Policy.Handle<Exception>().RetryAsync(onRetryAsync: async (exception, i) => await OnRetryAsync());



async Task OnRetryAsync()
{
    //My Async Code
}

I can't find any information on what's the difference between using retry1 and retry2. As I remember Polly 7 documentation it always use the second variant, why? retry1 seems more readable in my opinion.

0

There are 0 best solutions below