use of io.dingodb.raft.FSMCaller in project dingo by dingodb.
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