@Override
    public synchronized void shutdown() {
        if (this.shutdownLatch != null) {
            return;
        }
        LOG.info("Shutting down FSMCaller...");

        if (this.taskQueue != null) {
            final CountDownLatch latch = new CountDownLatch(1);
            this.shutdownLatch = latch;

            ThreadPoolsFactory.runInThread(getNode().getGroupId(), () -> this.taskQueue.publishEvent((task, sequence) -> {
                task.reset();
                task.type = TaskType.SHUTDOWN;
                task.shutdownLatch = latch;
            }));
        }
    }
Apply task for disruptor.

@author boyan (boyan@alibaba-inc.com)

2018-Apr-03 11:12:35 AM
jraft-core/src/main/java/com/alipay/sofa/jraft/core/FSMCallerImpl.java