|Constructor and Description|
|Modifier and Type||Method and Description|
Gracefully shutdown the given
Shuts the given
public static void gracefulShutdown(long timeout, TimeUnit unit, ExecutorService... executorServices)
ExecutorService. The call waits the given timeout that all ExecutorServices terminate. If the ExecutorServices do not terminate in this time, they will be shut down hard.
timeout- to wait for the termination of all ExecutorServices
unit- of the timeout
executorServices- to shut down
public static CompletableFuture<Void> nonBlockingShutdown(long timeout, TimeUnit unit, ExecutorService... executorServices)
ExecutorServicedown in a non-blocking fashion. The shut down will be executed by a thread from the common fork-join pool.
The executor services will be shut down gracefully for the given timeout period.
ExecutorService.shutdownNow() will be called.
Copyright © 2014–2023 The Apache Software Foundation. All rights reserved.