public void submit(final ITEM item) {
      // add the item to the processing queue
      blockAddedQueue.add(item);

      if (blockAddedLock.hasQueuedThreads()) {
        // another thread is already waiting to process the queue with our item, there is no need to
        // schedule another thread
        LOG.trace(
            "Block added event queue is already being processed and an already queued thread is present, nothing to do");
      } else {
        servicesExecutor.submit(
            () -> {
              blockAddedLock.lock();
              try {
                // now that we have the lock, process as many items as possible
                for (ITEM i = blockAddedQueue.poll(); i != null; i = blockAddedQueue.poll()) {
                  processor.accept(i);
                }
              } finally {
                blockAddedLock.unlock();
              }
            });
      }
    }
This class is a way to execute a set of tasks, one by one, in a strict order, without blocking
the caller in case there are still previous tasks queued

@param <ITEM> the class of item to be processed
ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/EthScheduler.java