<PackageReference Include="Polly" Version="8.0.0-alpha.3" />

AsyncCacheEngine

static class AsyncCacheEngine
using System; using System.Runtime.CompilerServices; using System.Threading; using System.Threading.Tasks; namespace Polly.Caching { internal static class AsyncCacheEngine { [System.Runtime.CompilerServices.NullableContext(1)] [AsyncStateMachine(typeof(<ImplementationAsync>d__0<>))] internal static Task<TResult> ImplementationAsync<[System.Runtime.CompilerServices.Nullable(2)] TResult>(IAsyncCacheProvider<TResult> cacheProvider, ITtlStrategy<TResult> ttlStrategy, Func<Context, string> cacheKeyStrategy, Func<Context, CancellationToken, Task<TResult>> action, Context context, CancellationToken cancellationToken, bool continueOnCapturedContext, Action<Context, string> onCacheGet, Action<Context, string> onCacheMiss, Action<Context, string> onCachePut, [System.Runtime.CompilerServices.Nullable(new byte[] { 2, 1, 1, 1 })] Action<Context, string, Exception> onCacheGetError, [System.Runtime.CompilerServices.Nullable(new byte[] { 2, 1, 1, 1 })] Action<Context, string, Exception> onCachePutError) { <ImplementationAsync>d__0<TResult> stateMachine = default(<ImplementationAsync>d__0<TResult>); stateMachine.<>t__builder = AsyncTaskMethodBuilder<TResult>.Create(); stateMachine.cacheProvider = cacheProvider; stateMachine.ttlStrategy = ttlStrategy; stateMachine.cacheKeyStrategy = cacheKeyStrategy; stateMachine.action = action; stateMachine.context = context; stateMachine.cancellationToken = cancellationToken; stateMachine.continueOnCapturedContext = continueOnCapturedContext; stateMachine.onCacheGet = onCacheGet; stateMachine.onCacheMiss = onCacheMiss; stateMachine.onCachePut = onCachePut; stateMachine.onCacheGetError = onCacheGetError; stateMachine.onCachePutError = onCachePutError; stateMachine.<>1__state = -1; stateMachine.<>t__builder.Start(ref stateMachine); return stateMachine.<>t__builder.Task; } } }