class WorkspaceBatchRunner implements Runnable {

    public void join() throws WorkerspaceQueueException {
        if (!started) {
            throw new WorkerspaceQueueException("Workspace batch runner already started");
        }

        if (stopped) {
            return;
        }

        stopped = true;
        doDequeue = false;

        try {
            waitMonitor.get();
        } catch (InterruptedException | ExecutionException e) {
            LOGGER.error(e);
            throw new WorkerspaceQueueException(e);
        }

        if (null != exceptionOccurred) {
            throw new WorkerspaceQueueException(exceptionOccurred);
        }
    }

    public  WorkspaceBatchRunner(HandlerIO handlerAsyncIO, Executor executor, int queueSize);

}