Class RateLimiterOperator<T>
java.lang.Object
io.github.resilience4j.reactor.ratelimiter.operator.RateLimiterOperator<T>
- Type Parameters:
T- the value type
- All Implemented Interfaces:
java.util.function.Function<org.reactivestreams.Publisher<T>,org.reactivestreams.Publisher<T>>,java.util.function.UnaryOperator<org.reactivestreams.Publisher<T>>
public class RateLimiterOperator<T>
extends java.lang.Object
implements java.util.function.UnaryOperator<org.reactivestreams.Publisher<T>>
A RateLimiter operator which checks if a downstream subscriber/observer can acquire a permission
to subscribe to an upstream Publisher. Otherwise emits a
RequestNotPermitted if the rate
limit is exceeded.-
Method Summary
Modifier and Type Method Description org.reactivestreams.Publisher<T>apply(org.reactivestreams.Publisher<T> publisher)static <T> RateLimiterOperator<T>of(io.github.resilience4j.ratelimiter.RateLimiter rateLimiter)Creates a RateLimiterOperator.
-
Method Details
-
of
public static <T> RateLimiterOperator<T> of(io.github.resilience4j.ratelimiter.RateLimiter rateLimiter)Creates a RateLimiterOperator.- Type Parameters:
T- the value type of the upstream and downstream- Parameters:
rateLimiter- the Rate limiter- Returns:
- a RateLimiterOperator
-
apply
-