code: private void scheduleBatchProcess(boolean immediate) {
          synchronized (mutex) {
              if (inbox.size() == 0)
                  return;
  
              // Schedule the processing. To improve latency, if we haven't processed anything
              // in at least our delay time, rush these object(s) through a minimum delay:
              long suggestedDelay = 0;
              if (!immediate && inbox.size() < capacity) {
                  // Check with the last processed time:
                  if (System.currentTimeMillis() - lastProcessedTime < delay)
                      suggestedDelay = delay;
                  else {
                      // Note: iOS schedules with 0 delay but the iOS implementation
                      // works on the runloop which still allows the current thread
                      // to continue queuing objects to the batcher until going out of
                      // the runloop. Java cannot do the same so giving a small delay to
                      // allow objects to be added to the batch if available:
                      suggestedDelay = Math.min(SMALL_DELAY_AFTER_LONG_PAUSE, delay);
                  }
              }
              scheduleWithDelay(suggestedDelay);
          }
      }
docs: Schedule batch process based on capacity, inbox size, and last processed time.
  @param immediate flag to schedule the batch process immediately regardless.