public interface RateLimiter
| Modifier and Type | Method and Description |
|---|---|
void |
rateLimit(Account account)
Called immediately before a request is made to the Brightpearl API for the given account.
|
void |
requestCapExceeded(Account account)
Called when a request to an account has been rejected due to request throttling.
|
void |
requestCompleted(Account account,
int requestsRemaining,
long nextThrottlePeriod)
Called after every request is made to the Brightpearl API, with values from the brightpearl-requests-remaining
and brightpearl-next-throttle-period headers.
|
void rateLimit(Account account)
account - The account a request will be sent to.void requestCompleted(Account account, int requestsRemaining, long nextThrottlePeriod)
rateLimit(Account)
method, but as other requests may have been made on other threads while this request was executing, the values
may be stale, and events may be received out of sequence.account - The account a response has been received from.requestsRemaining - The value of the brightpearl-requests-remaining response header.nextThrottlePeriod - The value of the brightpearl-next-throttle-period header.void requestCapExceeded(Account account)
rateLimit(Account) method. Other concurrent requests that were already started
at the time this event is received are likely to also fail.account - An account for which a request cap error has been received.Copyright © 2014. All Rights Reserved.