ResiliencePipelineAsyncPolicy
using System;
using System.Runtime.CompilerServices;
using System.Threading;
using System.Threading.Tasks;
namespace Polly.Utilities.Wrappers
{
internal sealed class ResiliencePipelineAsyncPolicy : AsyncPolicy
{
private readonly ResiliencePipeline _pipeline;
public ResiliencePipelineAsyncPolicy(ResiliencePipeline strategy)
: base((PolicyBuilder)null)
{
_pipeline = strategy;
}
[AsyncStateMachine(typeof(<ImplementationAsync>d__2))]
protected override Task ImplementationAsync(Func<Context, CancellationToken, Task> action, Context context, CancellationToken cancellationToken, bool continueOnCapturedContext)
{
<ImplementationAsync>d__2 stateMachine = default(<ImplementationAsync>d__2);
stateMachine.<>t__builder = AsyncTaskMethodBuilder.Create();
stateMachine.<>4__this = this;
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;
}
[AsyncStateMachine(typeof(<ImplementationAsync>d__3<>))]
protected override Task<TResult> ImplementationAsync<TResult>(Func<Context, CancellationToken, Task<TResult>> action, Context context, CancellationToken cancellationToken, bool continueOnCapturedContext)
{
<ImplementationAsync>d__3<TResult> stateMachine = default(<ImplementationAsync>d__3<TResult>);
stateMachine.<>t__builder = AsyncTaskMethodBuilder<TResult>.Create();
stateMachine.<>4__this = this;
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;
}
}
}