Table of Contents

Class CircuitBreakerManualControl

Namespace
Polly.CircuitBreaker
Assembly
Polly.Core.dll

Allows manual control of the circuit-breaker.

public sealed class CircuitBreakerManualControl
Inheritance
CircuitBreakerManualControl
Inherited Members

Remarks

The instance of this class can be reused across multiple circuit breakers.

Constructors

CircuitBreakerManualControl()

Initializes a new instance of the CircuitBreakerManualControl class.

public CircuitBreakerManualControl()

CircuitBreakerManualControl(bool)

Initializes a new instance of the CircuitBreakerManualControl class.

public CircuitBreakerManualControl(bool isIsolated)

Parameters

isIsolated bool

Determines whether the circuit breaker is isolated immediately after construction.

Methods

CloseAsync(CancellationToken)

Closes the circuit, and resets any statistics controlling automated circuit-breaking.

public Task CloseAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

The cancellation token.

Returns

Task

The instance of Task that represents the asynchronous execution.

Exceptions

ObjectDisposedException

Thrown when calling this method after this object is disposed.

IsolateAsync(CancellationToken)

Isolates (opens) the circuit manually, and holds it in this state until a call to CloseAsync(CancellationToken) is made.

public Task IsolateAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

The cancellation token.

Returns

Task

The instance of Task that represents the asynchronous execution.

Exceptions

ObjectDisposedException

Thrown when calling this method after this object is disposed.