Search in sources :

Example 1 with ServiceCallResultListener

use of com.tencent.polaris.client.api.ServiceCallResultListener in project polaris-java by polarismesh.

the class DefaultCircuitBreakAPI method subInit.

@Override
protected void subInit() {
    CircuitBreakerConfig cbConfig = sdkContext.getConfig().getConsumer().getCircuitBreaker();
    if (!cbConfig.isEnable()) {
        return;
    }
    List<ServiceCallResultListener> serviceCallResultListeners = ServiceCallResultListener.getServiceCallResultListeners(sdkContext);
    for (ServiceCallResultListener listener : serviceCallResultListeners) {
        if (listener instanceof ServiceCallResultChecker) {
            checker = (ServiceCallResultChecker) listener;
            break;
        }
    }
}
Also used : ServiceCallResultListener(com.tencent.polaris.client.api.ServiceCallResultListener) CircuitBreakerConfig(com.tencent.polaris.api.config.consumer.CircuitBreakerConfig)

Aggregations

CircuitBreakerConfig (com.tencent.polaris.api.config.consumer.CircuitBreakerConfig)1 ServiceCallResultListener (com.tencent.polaris.client.api.ServiceCallResultListener)1