code: public boolean makeCalls(long now) {
      if (now < nextDispatchTime)
        return true;
  
      // we make calls in a loop until all pending calls are drained
      // if any call hits an error - we stop
      while (!pendingCalls.isEmpty()) {
  
        TBase call = pendingCalls.get(0);
        try {
          // initialize the client/transport unless already done
          init();
  
          // make one thrift call
          dispatchCall(call);
  
          // if we made a call successfully, reset any retry state
          nextDispatchTime = -1;
          numRetries = 0;
          currentRetryInterval = retryIntervalStart;
  
          pendingCalls.remove(0);
  
        } catch (TException e) {
          boolean logged = false;
          if (e instanceof TTransportException) {
            TTransportException tte = (TTransportException) e;
            Throwable cause =  tte.getCause();
            if (cause != null && cause instanceof SocketTimeoutException) {
              // Got a socket timeout while waiting for a response from the
              // client. The session is stuck.
              logged = true;
              LOG.error("Call to session: " + handle + " for call: " +
                call.getClass().getName() + ", numRetry: " + numRetries +
                "(retryCountMax=" + retryCountMax + ")" +
                " failed with SocketTimeoutException, will retry it");
            }
          }
          if (!logged) {
            LOG.warn("Call to session: " + handle + " for call: " +
              call.getClass().getName() + ", numRetry: " + numRetries +
              "(retryCountMax=" + retryCountMax + ")" +
              " failed with TException", e);
          }
  
          // close the transport/client on any exception
          // will be reopened on next try
          close();
  
          if (numRetries > retryCountMax)
            return false;
  
          numRetries++;
          nextDispatchTime = now + currentRetryInterval;
          currentRetryInterval *= retryIntervalFactor;
  
          // no more calls for now
          return true;
        }
      }
  
      close();
  
      return true;
    }
docs: make callbacks to the sessiondriver. if the function returns false, then
  the session should be discarded
  
  @return true on success. false if no calls can be made to session anymore