55/// </summary>
66public class AsyncCircuitBreakerPolicy : AsyncPolicy , ICircuitBreakerPolicy
77{
8- internal readonly ICircuitController < EmptyStruct > _breakerController ;
8+ internal readonly ICircuitController < EmptyStruct > BreakerController ;
99
1010 internal AsyncCircuitBreakerPolicy (
1111 PolicyBuilder policyBuilder ,
1212 ICircuitController < EmptyStruct > breakerController )
1313 : base ( policyBuilder ) =>
14- _breakerController = breakerController ;
14+ BreakerController = breakerController ;
1515
1616 /// <summary>
1717 /// Gets the state of the underlying circuit.
1818 /// </summary>
19- public CircuitState CircuitState => _breakerController . CircuitState ;
19+ public CircuitState CircuitState => BreakerController . CircuitState ;
2020
2121 /// <summary>
2222 /// Gets the last exception handled by the circuit-breaker.
2323 /// <remarks>This will be null if no exceptions have been handled by the circuit-breaker since the circuit last closed.</remarks>
2424 /// </summary>
25- public Exception LastException => _breakerController . LastException ;
25+ public Exception LastException => BreakerController . LastException ;
2626
2727 /// <summary>
2828 /// Isolates (opens) the circuit manually, and holds it in this state until a call to <see cref="Reset()"/> is made.
2929 /// </summary>
3030 public void Isolate ( ) =>
31- _breakerController . Isolate ( ) ;
31+ BreakerController . Isolate ( ) ;
3232
3333 /// <summary>
3434 /// Closes the circuit, and resets any statistics controlling automated circuit-breaking.
3535 /// </summary>
3636 public void Reset ( ) =>
37- _breakerController . Reset ( ) ;
37+ BreakerController . Reset ( ) ;
3838
3939 /// <inheritdoc/>
4040 protected override async Task < TResult > ImplementationAsync < TResult > ( Func < Context , CancellationToken , Task < TResult > > action , Context context , CancellationToken cancellationToken ,
@@ -48,7 +48,7 @@ await AsyncCircuitBreakerEngine.ImplementationAsync<EmptyStruct>(
4848 continueOnCapturedContext ,
4949 ExceptionPredicates ,
5050 ResultPredicates < EmptyStruct > . None ,
51- _breakerController ) . ConfigureAwait ( continueOnCapturedContext ) ;
51+ BreakerController ) . ConfigureAwait ( continueOnCapturedContext ) ;
5252 return result ;
5353 }
5454}
@@ -59,42 +59,42 @@ await AsyncCircuitBreakerEngine.ImplementationAsync<EmptyStruct>(
5959/// <typeparam name="TResult">The return type of delegates which may be executed through the policy.</typeparam>
6060public class AsyncCircuitBreakerPolicy < TResult > : AsyncPolicy < TResult > , ICircuitBreakerPolicy < TResult >
6161{
62- internal readonly ICircuitController < TResult > _breakerController ;
62+ internal readonly ICircuitController < TResult > BreakerController ;
6363
6464 internal AsyncCircuitBreakerPolicy (
6565 PolicyBuilder < TResult > policyBuilder ,
6666 ICircuitController < TResult > breakerController )
6767 : base ( policyBuilder ) =>
68- _breakerController = breakerController ;
68+ BreakerController = breakerController ;
6969
7070 /// <summary>
7171 /// Gets the state of the underlying circuit.
7272 /// </summary>
73- public CircuitState CircuitState => _breakerController . CircuitState ;
73+ public CircuitState CircuitState => BreakerController . CircuitState ;
7474
7575 /// <summary>
7676 /// Gets the last exception handled by the circuit-breaker.
7777 /// <remarks>This will be null if no exceptions have been handled by the circuit-breaker since the circuit last closed.</remarks>
7878 /// </summary>
79- public Exception LastException => _breakerController . LastException ;
79+ public Exception LastException => BreakerController . LastException ;
8080
8181 /// <summary>
8282 /// Gets the last result returned from a user delegate which the circuit-breaker handled.
8383 /// <remarks>This will be default(<typeparamref name="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.</remarks>
8484 /// </summary>
85- public TResult LastHandledResult => _breakerController . LastHandledResult ;
85+ public TResult LastHandledResult => BreakerController . LastHandledResult ;
8686
8787 /// <summary>
8888 /// Isolates (opens) the circuit manually, and holds it in this state until a call to <see cref="Reset()"/> is made.
8989 /// </summary>
9090 public void Isolate ( ) =>
91- _breakerController . Isolate ( ) ;
91+ BreakerController . Isolate ( ) ;
9292
9393 /// <summary>
9494 /// Closes the circuit, and resets any statistics controlling automated circuit-breaking.
9595 /// </summary>
9696 public void Reset ( ) =>
97- _breakerController . Reset ( ) ;
97+ BreakerController . Reset ( ) ;
9898
9999 /// <inheritdoc/>
100100 [ DebuggerStepThrough ]
@@ -107,5 +107,5 @@ protected override Task<TResult> ImplementationAsync(Func<Context, CancellationT
107107 continueOnCapturedContext ,
108108 ExceptionPredicates ,
109109 ResultPredicates ,
110- _breakerController ) ;
110+ BreakerController ) ;
111111}
0 commit comments