private int countActiveConsumers() {
        int active = 0;
        for (FileResourceConsumer consumer : consumersManager.getConsumers()) {
            if (consumer.isStillActive()) {
                active++;
            }
        }
        return active;
    }
This is used instead of awaitTermination(), because that interrupts
the thread and then waits for its termination.  This politely waits.

@param causeForTermination reason for termination.
tika-batch/src/main/java/org/apache/tika/batch/BatchProcess.java