@Override
    public void onFailure() {
        final State currentState = state();
        if (currentState.isClosed()) {
            // fires failure event
            final EventCount updatedCount = currentState.counter().onFailure();
            // checks the count if it has been updated
            if (updatedCount != null) {
                // changes to OPEN if failure rate exceeds the threshold
                if (checkIfExceedingFailureThreshold(updatedCount) &&
                    state.compareAndSet(currentState, newOpenState())) {
                    logStateTransition(CircuitState.OPEN, updatedCount);
                    notifyStateChanged(CircuitState.OPEN);
                } else {
                    notifyCountUpdated(updatedCount);
                }
            }
        } else if (currentState.isHalfOpen()) {
            // returns to OPEN if a request fails during HALF_OPEN
            if (state.compareAndSet(currentState, newOpenState())) {
                logStateTransition(CircuitState.OPEN, null);
                notifyStateChanged(CircuitState.OPEN);
            }
        }
    }
Creates a new {@link NonBlockingCircuitBreaker} with the specified {@link Ticker} and
{@link CircuitBreakerConfig}.
core/src/main/java/com/linecorp/armeria/client/circuitbreaker/NonBlockingCircuitBreaker.java