Java Code Examples for ratpack.func.Function#apply()

The following examples show how to use ratpack.func.Function#apply() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Resilience4jConfig.java    From resilience4j with Apache License 2.0 5 votes vote down vote up
public Resilience4jConfig circuitBreaker(String name,
    Function<? super CircuitBreakerConfigurationProperties.InstanceProperties, ? extends CircuitBreakerConfigurationProperties.InstanceProperties> configure) {
    try {
        CircuitBreakerConfigurationProperties.InstanceProperties finalConfig = configure
            .apply(new CircuitBreakerConfigurationProperties.InstanceProperties());
        circuitbreaker.getInstances().put(name, finalConfig);
        return this;
    } catch (Exception e) {
        throw uncheck(e);
    }
}
 
Example 2
Source File: Resilience4jConfig.java    From resilience4j with Apache License 2.0 5 votes vote down vote up
public Resilience4jConfig rateLimiter(String name,
    Function<? super RateLimiterConfigurationProperties.InstanceProperties, ? extends RateLimiterConfigurationProperties.InstanceProperties> configure) {
    try {
        RateLimiterConfigurationProperties.InstanceProperties finalConfig = configure
            .apply(new RateLimiterConfigurationProperties.InstanceProperties());
        ratelimiter.getInstances().put(name, finalConfig);
        return this;
    } catch (Exception e) {
        throw uncheck(e);
    }
}
 
Example 3
Source File: Resilience4jConfig.java    From resilience4j with Apache License 2.0 5 votes vote down vote up
public Resilience4jConfig retry(String name,
    Function<? super RetryConfigurationProperties.InstanceProperties, ? extends RetryConfigurationProperties.InstanceProperties> configure) {
    try {
        RetryConfigurationProperties.InstanceProperties finalConfig = configure
            .apply(new RetryConfigurationProperties.InstanceProperties());
        retry.getInstances().put(name, finalConfig);
        return this;
    } catch (Exception e) {
        throw uncheck(e);
    }
}
 
Example 4
Source File: Resilience4jConfig.java    From resilience4j with Apache License 2.0 5 votes vote down vote up
public Resilience4jConfig bulkhead(String name,
    Function<? super BulkheadConfigurationProperties.InstanceProperties, ? extends BulkheadConfigurationProperties.InstanceProperties> configure) {
    try {
        BulkheadConfigurationProperties.InstanceProperties finalConfig = configure
            .apply(new BulkheadConfigurationProperties.InstanceProperties());
        bulkhead.getInstances().put(name, finalConfig);
        return this;
    } catch (Exception e) {
        throw uncheck(e);
    }
}
 
Example 5
Source File: Resilience4jConfig.java    From resilience4j with Apache License 2.0 5 votes vote down vote up
public Resilience4jConfig threadPoolBulkhead(String name,
    Function<? super ThreadPoolBulkheadConfigurationProperties.InstanceProperties, ? extends ThreadPoolBulkheadConfigurationProperties.InstanceProperties> configure) {
    try {
        ThreadPoolBulkheadConfigurationProperties.InstanceProperties finalConfig = configure
            .apply(new ThreadPoolBulkheadConfigurationProperties.InstanceProperties());
        threadpoolbulkhead.getInstances().put(name, finalConfig);
        return this;
    } catch (Exception e) {
        throw uncheck(e);
    }
}
 
Example 6
Source File: Resilience4jConfig.java    From resilience4j with Apache License 2.0 5 votes vote down vote up
public Resilience4jConfig timeLimiter(String name,
                                      Function<? super TimeLimiterConfigurationProperties.InstanceProperties, ? extends TimeLimiterConfigurationProperties.InstanceProperties> configure) {
    try {
        TimeLimiterConfigurationProperties.InstanceProperties finalConfig = configure
            .apply(new TimeLimiterConfigurationProperties.InstanceProperties());
        timeLimiter.getInstances().put(name, finalConfig);
        return this;
    } catch (Exception e) {
        throw uncheck(e);
    }
}
 
Example 7
Source File: Resilience4jConfig.java    From resilience4j with Apache License 2.0 5 votes vote down vote up
public Resilience4jConfig endpoints(
    Function<? super EndpointsConfig, ? extends EndpointsConfig> configure) {
    try {
        endpoints = configure.apply(new EndpointsConfig());
        return this;
    } catch (Exception e) {
        throw uncheck(e);
    }
}
 
Example 8
Source File: EndpointsConfig.java    From resilience4j with Apache License 2.0 5 votes vote down vote up
public EndpointsConfig circuitBreakers(
    Function<? super EndpointConfig, ? extends EndpointConfig> configure) {
    try {
        circuitbreaker = configure.apply(new EndpointConfig("circuitbreaker"));
        return this;
    } catch (Exception e) {
        throw uncheck(e);
    }
}
 
Example 9
Source File: EndpointsConfig.java    From resilience4j with Apache License 2.0 5 votes vote down vote up
public EndpointsConfig rateLimiters(
    Function<? super EndpointConfig, ? extends EndpointConfig> configure) {
    try {
        ratelimiter = configure.apply(new EndpointConfig("ratelimiter"));
        return this;
    } catch (Exception e) {
        throw uncheck(e);
    }
}
 
Example 10
Source File: EndpointsConfig.java    From resilience4j with Apache License 2.0 5 votes vote down vote up
public EndpointsConfig retries(
    Function<? super EndpointConfig, ? extends EndpointConfig> configure) {
    try {
        retry = configure.apply(new EndpointConfig("retry"));
        return this;
    } catch (Exception e) {
        throw uncheck(e);
    }
}
 
Example 11
Source File: EndpointsConfig.java    From resilience4j with Apache License 2.0 5 votes vote down vote up
public EndpointsConfig bulkheads(
    Function<? super EndpointConfig, ? extends EndpointConfig> configure) {
    try {
        bulkhead = configure.apply(new EndpointConfig("bulkhead"));
        return this;
    } catch (Exception e) {
        throw uncheck(e);
    }
}
 
Example 12
Source File: EndpointsConfig.java    From resilience4j with Apache License 2.0 5 votes vote down vote up
public EndpointsConfig threadPoolBulkheads(
    Function<? super EndpointConfig, ? extends EndpointConfig> configure) {
    try {
        threadpoolbulkhead = configure.apply(new EndpointConfig("threadpoolbulkhead"));
        return this;
    } catch (Exception e) {
        throw uncheck(e);
    }
}
 
Example 13
Source File: EndpointsConfig.java    From resilience4j with Apache License 2.0 5 votes vote down vote up
public EndpointsConfig timeLimiters(
    Function<? super EndpointConfig, ? extends EndpointConfig> configure) {
    try {
        timelimiter = configure.apply(new EndpointConfig("timelimiter"));
        return this;
    } catch (Exception e) {
        throw uncheck(e);
    }
}