<PackageReference Include="Polly" Version="8.4.0" />

AsyncNoOpPolicy

A noop policy that can be applied to asynchronous delegates.
using System; using System.Diagnostics; using System.Runtime.CompilerServices; using System.Threading; using System.Threading.Tasks; namespace Polly.NoOp { public class AsyncNoOpPolicy : AsyncPolicy, INoOpPolicy, IsPolicy { internal AsyncNoOpPolicy() : base((PolicyBuilder)null) { } [System.Runtime.CompilerServices.NullableContext(1)] [DebuggerStepThrough] protected override Task<TResult> ImplementationAsync<[System.Runtime.CompilerServices.Nullable(0)] TResult>(Func<Context, CancellationToken, Task<TResult>> action, Context context, CancellationToken cancellationToken, bool continueOnCapturedContext) { return NoOpEngine.ImplementationAsync(action, context, cancellationToken); } } }