All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.smaato.switchgear.circuitbreaker.state.bucket.BucketedFailureStatesHolder Maven / Gradle / Ivy

Go to download

Switchgear is a Java library that provides an API for call isolation, timeouts, and circuit breaker functionality. Our main goal is to achieve minimal performance overhead of the library, even when used in the hottest place of your application. Additionally, we've opted for zero transitive dependencies and maintaining a fluent API.

The newest version!
package com.smaato.switchgear.circuitbreaker.state.bucket;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

import com.smaato.switchgear.circuitbreaker.state.LastFailureCause;

public class BucketedFailureStatesHolder {

    private final Map failureStates = new ConcurrentHashMap<>();

    public LastFailureCause getFailureState(final BucketRange timeoutBucketRange) {
        return failureStates.computeIfAbsent(timeoutBucketRange, ignored -> new LastFailureCause());
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy