Class DefaultRateLimiterProvider
java.lang.Object
com.sap.cloud.sdk.cloudplatform.resilience4j.DefaultRateLimiterProvider
- All Implemented Interfaces:
GenericDecorator,RateLimiterProvider
public class DefaultRateLimiterProvider
extends Object
implements RateLimiterProvider, GenericDecorator
Decorates a callable with a rate limiter based on a provided resilience configuration.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<T> Callable<T>decorateCallable(Callable<T> callable, ResilienceConfiguration configuration) Decorates the given callable to enable a resilient property.io.github.resilience4j.ratelimiter.RateLimitergetRateLimiter(ResilienceConfiguration configuration) Provides a rate limiter.
-
Constructor Details
-
DefaultRateLimiterProvider
public DefaultRateLimiterProvider()
-
-
Method Details
-
decorateCallable
@Nonnull public <T> Callable<T> decorateCallable(@Nonnull Callable<T> callable, @Nonnull ResilienceConfiguration configuration) Description copied from interface:GenericDecoratorDecorates the given callable to enable a resilient property.- Specified by:
decorateCallablein interfaceGenericDecorator- Type Parameters:
T- The type of the callable.- Parameters:
callable- The callable to decorate.configuration- The configuration to be used.- Returns:
- The decorated callable.
-
getRateLimiter
@Nonnull public io.github.resilience4j.ratelimiter.RateLimiter getRateLimiter(@Nonnull ResilienceConfiguration configuration) Description copied from interface:RateLimiterProviderProvides a rate limiter.- Specified by:
getRateLimiterin interfaceRateLimiterProvider- Parameters:
configuration- The configuration for constructing the rate limiter.- Returns:
- A rate limiter.
-