AsyncBulkheadEngine
using System;
using System.Runtime.CompilerServices;
using System.Threading;
using System.Threading.Tasks;
namespace Polly.Bulkhead
{
    internal static class AsyncBulkheadEngine
    {
        [System.Runtime.CompilerServices.NullableContext(1)]
        [AsyncStateMachine(typeof(<ImplementationAsync>d__0<>))]
        internal static Task<TResult> ImplementationAsync<[System.Runtime.CompilerServices.Nullable(2)] TResult>(Func<Context, CancellationToken, Task<TResult>> action, Context context, Func<Context, Task> onBulkheadRejectedAsync, SemaphoreSlim maxParallelizationSemaphore, SemaphoreSlim maxQueuedActionsSemaphore, bool continueOnCapturedContext, CancellationToken cancellationToken)
        {
            <ImplementationAsync>d__0<TResult> stateMachine = default(<ImplementationAsync>d__0<TResult>);
            stateMachine.<>t__builder = AsyncTaskMethodBuilder<TResult>.Create();
            stateMachine.action = action;
            stateMachine.context = context;
            stateMachine.onBulkheadRejectedAsync = onBulkheadRejectedAsync;
            stateMachine.maxParallelizationSemaphore = maxParallelizationSemaphore;
            stateMachine.maxQueuedActionsSemaphore = maxQueuedActionsSemaphore;
            stateMachine.continueOnCapturedContext = continueOnCapturedContext;
            stateMachine.cancellationToken = cancellationToken;
            stateMachine.<>1__state = -1;
            stateMachine.<>t__builder.Start(ref stateMachine);
            return stateMachine.<>t__builder.Task;
        }
    }
}