use of com.alipay.sofa.jraft.FSMCaller in project sofa-jraft by sofastack.
the class FSMCallerImpl method shutdown.
@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;
Utils.runInThread(() -> this.taskQueue.publishEvent((task, sequence) -> {
task.reset();
task.type = TaskType.SHUTDOWN;
task.shutdownLatch = latch;
}));
}
doShutdown();
}
Aggregations