AsyncRateLimitEngine
using System;
using System.Runtime.CompilerServices;
using System.Threading;
using System.Threading.Tasks;
namespace Polly.RateLimit
{
internal static class AsyncRateLimitEngine
{
[System.Runtime.CompilerServices.NullableContext(1)]
[AsyncStateMachine(typeof(<ImplementationAsync>d__0<>))]
internal static Task<TResult> ImplementationAsync<[System.Runtime.CompilerServices.Nullable(2)] TResult>(IRateLimiter rateLimiter, [System.Runtime.CompilerServices.Nullable(new byte[] {
2,
1,
1
})] Func<TimeSpan, Context, TResult> retryAfterFactory, Func<Context, CancellationToken, Task<TResult>> action, Context context, CancellationToken cancellationToken, bool continueOnCapturedContext)
{
<ImplementationAsync>d__0<TResult> stateMachine = default(<ImplementationAsync>d__0<TResult>);
stateMachine.<>t__builder = AsyncTaskMethodBuilder<TResult>.Create();
stateMachine.rateLimiter = rateLimiter;
stateMachine.retryAfterFactory = retryAfterFactory;
stateMachine.action = action;
stateMachine.context = context;
stateMachine.cancellationToken = cancellationToken;
stateMachine.continueOnCapturedContext = continueOnCapturedContext;
stateMachine.<>1__state = -1;
stateMachine.<>t__builder.Start(ref stateMachine);
return stateMachine.<>t__builder.Task;
}
}
}