Package com.atlan.net
Class GlobalRateLimiter
java.lang.Object
com.atlan.net.GlobalRateLimiter
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 Summary
Modifier and TypeMethodDescriptionstatic GlobalRateLimiter
void
setRateLimit
(long retryAfterMillis) Record that a rate limit is effective.void
Check if we should wait due to a rate limit, and if so actually do that wait.
-
Method Details
-
getInstance
-
waitIfRateLimited
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
-