code: private void scheduleWithDelay(long delay) {
          synchronized (mutex) {
              if (scheduled && delay < scheduledDelay) {
                  if (isPendingFutureReadyOrInProcessing()) {
                      // Ignore as there is one batch currently in processing or ready to be processed:
                      Log.v(Log.TAG_BATCHER, "%s: scheduleWithDelay: %d ms, ignored as current batch " +
                              "is ready or in process", this, delay);
                      return;
                  }
                  unschedule();
              }
  
              if (!scheduled) {
                  scheduled = true;
                  scheduledDelay = delay;
                  Log.v(Log.TAG_BATCHER, "%s: scheduleWithDelay %d ms, scheduled ...", this, delay);
                  synchronized (workExecutor) {
                      if (!workExecutor.isShutdown()) {
                          pendingFuture = workExecutor.schedule(new Runnable() {
                              @Override
                              public void run() {
                                  Log.v(Log.TAG_BATCHER, "%s: call processNow ...", this);
                                  processNow();
                                  Log.v(Log.TAG_BATCHER, "%s: call processNow done", this);
                              }
                          }, scheduledDelay, TimeUnit.MILLISECONDS);
                      }
                  }
              } else
                  Log.v(Log.TAG_BATCHER, "%s: scheduleWithDelay %d ms, ignored", this, delay);
          }
      }
docs: Schedule the batch processing with the delay. If there is one batch currently
  in processing, the schedule will be ignored as after the processing is done,
  the next batch will be rescheduled.
  @param delay delay to schedule the work executor to process the next batch.