docs: public long execute(Consumer<StatusContext> block) {
          long numUnitsProcessed = 0L;
  
  
          // Keep track of average time used per unig (average time per unit)
          MovingAverage averageTPU = new MovingAverage();
  
          // Average imposed delay
          MovingAverage averageDelay = new MovingAverage();
  
          StatusContext statusContext = new StatusContext();
  
          while (numUnitsProcessed < maxUnitsProcessedInSequence) {
  
              statusContext.reset();
  
              synchronized (semaphore) {
                  if (shutdownRequests.size() > 0) {
                      String info = "Shutting down processing due to request: " + shutdownRequests.remove(0);
                      out.println(info);
                      inform(numUnitsProcessed, averageTPU, averageDelay);
  
                      return numUnitsProcessed;
                  }
              }
  
              long startTime = System.currentTimeMillis();
              block.accept(statusContext);
              long endTime = System.currentTimeMillis();
  
              if (statusContext.isFinished() || (!statusContext.getStatus() && --numberOfErrorsAccepted < 0)) {
                  return numUnitsProcessed;
              }
  
              averageTPU.update(endTime - startTime);
              ++numUnitsProcessed;
  
              // Possibly delay processing so that we do not process more than 'maxUnitsProcessedPerMinute' - on average
              final double slotTime = (60000) / maxUnitsProcessedPerMinute;   // milliseconds
              double averageProcessingTime = averageTPU.getAverage(); // milliseconds
              long waitTime = (long) (slotTime - Math.ceil(averageProcessingTime));  // milliseconds
  
              if (waitTime > 0) {
                  averageDelay.update(waitTime);
                  synchronized (semaphore) {
                      try {
                          semaphore.wait(waitTime);
                      } catch (InterruptedException ignore) {}
                  }
              }
              synchronized (semaphore) {
                  if (shutdownRequests.size() > 0) {
                      String info = "Shutting down processing due to request: " + shutdownRequests.remove(0);
                      out.println(info);
                      inform(numUnitsProcessed, averageTPU, averageDelay);
  
                      return numUnitsProcessed;
                  }
              }
  
              if ((numUnitsProcessed % INFORM_EACH_N_UNITS) == 0) {
                  // Inform each N:th time through
                  inform(numUnitsProcessed, averageTPU, averageDelay);
              }
          }
          if ((numUnitsProcessed % INFORM_EACH_N_UNITS) != 0) {
              // Only inform if we have not just done that :)
              inform(numUnitsProcessed, averageTPU, averageDelay);
          }
          return numUnitsProcessed;
      }