code: public void attempt(final Request request, final APICallback callback) {
      this.pool.execute(new Runnable() {
        @Override
        public void run() {
          Response response;
  
          // Retry until the retry limit has been reached.
          for (int i = 0; i < rateLimitRetry; ++i) {
            try {
              response = api(request);
            } catch (IOException ex) {
              // Stop retrying if there is a network error.
              callback.error(ex);
              return;
            }
  
            // We have been rate limited.
            if (response.getStatusCode() == RATE_LIMIT_RESPONSE_CODE) {
              try {
                Thread.sleep(rateLimitSleep);
              } catch (InterruptedException ex) {
                // Can safely ignore this exception and retry.
              }
            } else {
              callback.response(response);
              return;
            }
          }
  
          // Retries exhausted. Return error.
          callback.error(new RateLimitException(request, rateLimitRetry));
        }
      });
    }
docs: Attempt an API call. This method executes the API call asynchronously
  on an internal thread pool. If the call is rate limited, the thread
  will retry up to the maximum configured time. The supplied callback
  will be called in the event of an error, or a successful response.
  @param request the API request.
  @param callback the callback.