public void addShutdownHook(final Runnable task) {
        execute(() -> MpscSingleThreadExecutor.this.shutdownHooks.add(task));
    }
Add a {@link Runnable} which will be executed on shutdown of this instance.
jraft-core/src/main/java/com/alipay/sofa/jraft/util/concurrent/MpscSingleThreadExecutor.java