Polly.Policy.BulkheadAsync C# (CSharp) Method

BulkheadAsync() public static method

Builds a bulkhead isolation Policy, which limits the maximum concurrency of actions executed through the policy. Imposing a maximum concurrency limits the potential of governed actions, when faulting, to bring down the system.

When an execution would cause the number of actions executing concurrently through the policy to exceed maxParallelization, the action is not executed and a BulkheadRejectedException is thrown.

public static BulkheadAsync ( int maxParallelization ) : BulkheadPolicy
maxParallelization int The maximum number of concurrent actions that may be executing through the policy.
return BulkheadPolicy
        public static BulkheadPolicy BulkheadAsync(int maxParallelization)
        {
            Func<Context, Task> doNothingAsync = _ => TaskHelper.EmptyTask;
            return BulkheadAsync(maxParallelization, 0, doNothingAsync);
        }

Same methods

Policy::BulkheadAsync ( int maxParallelization, Task>.Func onBulkheadRejectedAsync ) : BulkheadPolicy
Policy::BulkheadAsync ( int maxParallelization, int maxQueuingActions ) : BulkheadPolicy
Policy::BulkheadAsync ( int maxParallelization, int maxQueuingActions, Task>.Func onBulkheadRejectedAsync ) : BulkheadPolicy