Table of Contents

Class CircuitBreakerPolicy<TResult>

Namespace
Polly.CircuitBreaker
Assembly
Polly.dll

A circuit-breaker policy that can be applied to delegates returning a value of type TResult.

public class CircuitBreakerPolicy<TResult> : Policy<TResult>, IAsyncPolicy<TResult>, ISyncPolicy<TResult>, ICircuitBreakerPolicy<TResult>, ICircuitBreakerPolicy, IsPolicy

Type Parameters

TResult
Inheritance
Policy<TResult>
CircuitBreakerPolicy<TResult>
Implements
IAsyncPolicy<TResult>
ISyncPolicy<TResult>
Inherited Members

Properties

CircuitState

Gets the state of the underlying circuit.

public CircuitState CircuitState { get; }

Property Value

CircuitState

LastException

Gets the last exception handled by the circuit-breaker. This will be null if no exceptions have been handled by the circuit-breaker since the circuit last closed, or if the last event handled by the circuit was a handled TResult value.

public Exception LastException { get; }

Property Value

Exception

LastHandledResult

Gets the last result returned from a user delegate which the circuit-breaker handled. This will be default(TResult) if no results have been handled by the circuit-breaker since the circuit last closed, or if the last event handled by the circuit was an exception.

public TResult LastHandledResult { get; }

Property Value

TResult

Methods

Isolate()

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

public void Isolate()

Reset()

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

public void Reset()