Interface Ratelimiter

    • Field Detail

      • logger

        static final com.google.common.flogger.FluentLogger logger
    • Method Detail

      • calculateOffset

        static int calculateOffset​(int rps,
                                   int size)
      • apply

        java.util.concurrent.CompletableFuture<REST.Request> apply​(RatelimitedEndpoint restEndpoint,
                                                                   REST.Request request)
        Applies the provided request with the given endpoint to this ratelimiter and returns a CompletionStage that completes with the given request as soon as this ratelimiter allows its execution.
        Specified by:
        apply in interface java.util.function.BiFunction<RatelimitedEndpoint,​REST.Request,​java.util.concurrent.CompletableFuture<REST.Request>>
        Parameters:
        restEndpoint - The endpoint that is gonna be accessed
        request - The request that is yet to be executed
        Returns:
        A CompletableFuture that completes as soon as the ratelimiter allows execution of the request.