public synchronized void pause() {
        final boolean didChange = isPaused.compareAndSet(false, true);
        if (didChange) {
            // Drain all permits currently available. Any running tasks will still hold a permit though
            pauseSemaphore.drainPermits();
            LOGGER.info(() -> LogUtil.message(
                    "Paused parallel executor '{}', threadCount: {}, availablePermits: {}",
                    threadNamePrefix, threadCount, pauseSemaphore.availablePermits()));
        }
    }
Pause the executor. Any currently running tasks will continue to run,
but no new tasks will be executed.
If already paused, is a noop.
Call resume to resume processing.
stroom-proxy/stroom-proxy-repo/src/main/java/stroom/proxy/repo/ParallelExecutor.java