Skip to content

Commit e603b79

Browse files
author
guyplusplus
committed
typo fixed
1 parent c381d9f commit e603b79

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ This library is a Simple Circuit Breaker for JAVA 7 and above. It is directly in
55
It supports the 5 states:
66
- OPEN
77
- CLOSED
8-
- HALF-OPEN
8+
- HALF_OPEN
99
- DISABLED: broker is always closed (via property slidingWindowSize)
1010
- FORCED_OPEN: broker is always opened (via property slidingWindowSize)
1111

@@ -24,7 +24,7 @@ maxDurationOpenInHalfOpenState is a new property described in the sample code pa
2424
| slidingWindowSize | 100 [s] | 0 to set breaker in DISABLED state, -1 to set breaker in FORCED_OPEN state |
2525
| minimumNumberOfCalls | 10 | |
2626
| waitDurationInOpenState | 60000 [ms] | |
27-
| maxDurationOpenInHalfOpenState | 120000 [ms] | If set to 0, there is no limit |
27+
| maxDurationOpenInHalfOpenState | 120000 [ms] | If set to 0, the breaker in HALF_OPEN state will wait forever for the outcome (fail or success) of all the permittedNumberOfCallsInHalfOpenState calls |
2828

2929

3030
## Sample Code
@@ -43,9 +43,9 @@ loop
4343
circuitBreaker.callFailed(doSomething duration);
4444
```
4545

46-
**Important**: `callSucceeded()` or `callFailed()` must always be invoked after `isClosedForThisCall()`. Otherwise breaker in HALF-OPEN state will never move to another state, waiting for the results of the permittedNumberOfCallsInHalfOpenState calls.
46+
**Important**: `callSucceeded()` or `callFailed()` must always be invoked after `isClosedForThisCall()`. Otherwise breaker in HALF_OPEN state will never move to another state, waiting for the results of the permittedNumberOfCallsInHalfOpenState calls.
4747

48-
To avoid this situation a new property called maxDurationOpenInHalfOpenState is introduced. In HALF-OPEN state, after permittedNumberOfCallsInHalfOpenState calls (`isClosedForThisCall()` returns true), all its subsequent calls (`isClosedForThisCall()` returns false) should not be executed as the circuit is opened. If this situation lasts longer than maxDurationOpenInHalfOpenState ms, the breaker goes back automatically to the CLOSED state.
48+
To avoid this situation a new property called maxDurationOpenInHalfOpenState is introduced. In HALF_OPEN state, after permittedNumberOfCallsInHalfOpenState calls (`isClosedForThisCall()` returns true), all its subsequent calls (`isClosedForThisCall()` returns false) should not be executed as the circuit is opened. If this situation lasts longer than maxDurationOpenInHalfOpenState ms, the breaker goes back automatically to the CLOSED state.
4949

5050
## Circuit Breaker Configuration using Properties
5151
The circuit breaker can easily be configured using `java.util.Properties`, possibly adding prefix, for example:

src/main/java/com/geckotechnology/simpleCircuitBreaker/BreakerHalfOpenState.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public boolean isClosedForThisCall() {
3838
circuitBreaker.moveToClosedState();
3939
return circuitBreaker.isClosedForThisCall();
4040
}
41-
//situation normal, no more calls allowed
41+
//situation normal, no more call allowed
4242
return false;
4343
}
4444

src/main/java/com/geckotechnology/simpleCircuitBreaker/BreakerOpenState.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class BreakerOpenState implements BreakerStateInterface {
1212

1313
@Override
1414
public boolean isClosedForThisCall() {
15-
//check if need to move to hald-open
15+
//check if need to move to half-open
1616
if(System.currentTimeMillis() >= openStateEndTimestamp) {
1717
if(circuitBreaker.getCircuitBreakerConfig().getPermittedNumberOfCallsInHalfOpenState() == 0)
1818
circuitBreaker.moveToClosedState();

0 commit comments

Comments
 (0)