Class EnvoyRateLimiter

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean allow​(int permits)
      Blocks until the specified number of permits are acquired and returns true if the request was allowed or false if the request was rejected.
      void close()  
      • Methods inherited from class java.lang.Object

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

      • allow

        public boolean allow​(int permits)
                      throws java.io.IOException,
                             java.lang.InterruptedException
        Description copied from interface: RateLimiter
        Blocks until the specified number of permits are acquired and returns true if the request was allowed or false if the request was rejected.
        Specified by:
        allow in interface RateLimiter
        Parameters:
        permits - Number of permits to acquire.
        Returns:
        true if the request was allowed, false if it was rejected (and retries exceeded).
        Throws:
        java.io.IOException - if there is an error communicating with the rate limiter service.
        java.lang.InterruptedException - if the thread is interrupted while waiting.
      • close

        public void close()
                   throws java.lang.Exception
        Specified by:
        close in interface java.lang.AutoCloseable
        Throws:
        java.lang.Exception