Shipstation v0.3.0 Shipstation.RequestLimit
This module is designed to record and handle the backpressure obligations the API client has against the API.
When a request is made, the response headers contain information about how many requests are allowed to be done within a given timeframe. This information is then stored in our Agent and used to determine if we should wait or not. Should the API Client go over the limit, the client will backoff, blocking the request until the elapsed time has been reached.
Summary
Functions
Wait a specified amount of time, so that the API has room to breathe
This function lets us set the rate information we’re getting back from the API
This function allows us to anticipate whether the API will reject our request
Functions
calculate_backoff_period(future_time :: %DateTime{calendar: term, day: term, hour: term, microsecond: term, minute: term, month: term, second: term, std_offset: term, time_zone: term, utc_offset: term, year: term, zone_abbr: term}) :: non_neg_integer
This function lets us set the rate information we’re getting back from the API
This function allows us to anticipate whether the API will reject our request