Class RateLimiterOperator<T>

java.lang.Object
io.github.resilience4j.ratelimiter.operator.RateLimiterOperator<T>
Type Parameters:
T - the value type
All Implemented Interfaces:
io.reactivex.CompletableTransformer, io.reactivex.FlowableTransformer<T,​T>, io.reactivex.MaybeTransformer<T,​T>, io.reactivex.ObservableTransformer<T,​T>, io.reactivex.SingleTransformer<T,​T>

public class RateLimiterOperator<T>
extends java.lang.Object
implements io.reactivex.FlowableTransformer<T,​T>, io.reactivex.SingleTransformer<T,​T>, io.reactivex.MaybeTransformer<T,​T>, io.reactivex.CompletableTransformer, io.reactivex.ObservableTransformer<T,​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
    io.reactivex.CompletableSource apply​(io.reactivex.Completable upstream)  
    org.reactivestreams.Publisher<T> apply​(io.reactivex.Flowable<T> upstream)  
    io.reactivex.MaybeSource<T> apply​(io.reactivex.Maybe<T> upstream)  
    io.reactivex.ObservableSource<T> apply​(io.reactivex.Observable<T> upstream)  
    io.reactivex.SingleSource<T> apply​(io.reactivex.Single<T> upstream)  
    static <T> RateLimiterOperator<T> of​(io.github.resilience4j.ratelimiter.RateLimiter rateLimiter)
    Creates a RateLimiterOperator.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • of

      public static <T> RateLimiterOperator<T> of​(io.github.resilience4j.ratelimiter.RateLimiter rateLimiter)
      Creates a RateLimiterOperator.
      Parameters:
      rateLimiter - the RateLimiter
      Returns:
      a RateLimiterOperator
    • apply

      public org.reactivestreams.Publisher<T> apply​(io.reactivex.Flowable<T> upstream)
      Specified by:
      apply in interface io.reactivex.FlowableTransformer<T,​T>
    • apply

      public io.reactivex.SingleSource<T> apply​(io.reactivex.Single<T> upstream)
      Specified by:
      apply in interface io.reactivex.SingleTransformer<T,​T>
    • apply

      public io.reactivex.CompletableSource apply​(io.reactivex.Completable upstream)
      Specified by:
      apply in interface io.reactivex.CompletableTransformer
    • apply

      public io.reactivex.MaybeSource<T> apply​(io.reactivex.Maybe<T> upstream)
      Specified by:
      apply in interface io.reactivex.MaybeTransformer<T,​T>
    • apply

      public io.reactivex.ObservableSource<T> apply​(io.reactivex.Observable<T> upstream)
      Specified by:
      apply in interface io.reactivex.ObservableTransformer<T,​T>