Class RateLimiterCallAdapter

java.lang.Object
retrofit2.CallAdapter.Factory
io.github.resilience4j.retrofit.RateLimiterCallAdapter

public final class RateLimiterCallAdapter
extends retrofit2.CallAdapter.Factory
Creates a Retrofit CallAdapter.Factory that decorates a Call to provide integration with a supplied RateLimiter
  • Method Summary

    Modifier and Type Method Description
    retrofit2.CallAdapter<?,​?> get​(java.lang.reflect.Type returnType, java.lang.annotation.Annotation[] annotations, retrofit2.Retrofit retrofit)  
    static RateLimiterCallAdapter of​(io.github.resilience4j.ratelimiter.RateLimiter rateLimiter)
    Create a rate-limiting call adapter factory that decorates retrofit calls

    Methods inherited from class retrofit2.CallAdapter.Factory

    getParameterUpperBound, getRawType

    Methods inherited from class java.lang.Object

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

    • of

      public static RateLimiterCallAdapter of​(io.github.resilience4j.ratelimiter.RateLimiter rateLimiter)
      Create a rate-limiting call adapter factory that decorates retrofit calls
      Parameters:
      rateLimiter - rate limiter to use
      Returns:
      a CallAdapter.Factory that can be passed into the Retrofit.Builder
    • get

      public retrofit2.CallAdapter<?,​?> get​(java.lang.reflect.Type returnType, java.lang.annotation.Annotation[] annotations, retrofit2.Retrofit retrofit)
      Specified by:
      get in class retrofit2.CallAdapter.Factory