Package com.atlan.net

Class GlobalRateLimiter

java.lang.Object
com.atlan.net.GlobalRateLimiter

public class GlobalRateLimiter extends Object
Cross-thread, global rate limiting mechanism -- so if at any point the SDK receives a 429 response that it is being rate-limited (throttled) then we can centrally pause and coordinate retries across all threads, rather than allowing individual threads to further overwhelm the throttling via their own independent requests.
  • Method Details

    • getInstance

      public static GlobalRateLimiter getInstance()
    • waitIfRateLimited

      public void waitIfRateLimited() throws InterruptedException
      Check if we should wait due to a rate limit, and if so actually do that wait.
      Throws:
      InterruptedException - on any interruption
    • setRateLimit

      public void setRateLimit(long retryAfterMillis)
      Record that a rate limit is effective.
      Parameters:
      retryAfterMillis - amount of time to wait (in milliseconds) before resuming