public static CompletableFuture<Void> addClosingTask(
            AutoCloseable autoCloseable, Runnable whenClosing) {
        requireNonNull(whenClosing, "whenClosing");
        return addClosingTask(autoCloseable, whenClosing, autoCloseable.getClass().getSimpleName());
    }
Adds an {@link AutoCloseable} and a {@link Runnable} to the JVM shutdown hook.
core/src/main/java/com/linecorp/armeria/common/util/ShutdownHooks.java