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
boolDetermines 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
CancellationTokenThe cancellation token.
Returns
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
CancellationTokenThe cancellation token.
Returns
Exceptions
- ObjectDisposedException
Thrown when calling this method after this object is disposed.