Class ExecutorShutdown

java.lang.Object
org.occurrent.subscription.internal.ExecutorShutdown

public class ExecutorShutdown extends Object
Utility functions for shutting down executor services.
  • Constructor Details

    • ExecutorShutdown

      public ExecutorShutdown()
  • Method Details

    • shutdownSafely

      public static void shutdownSafely(ExecutorService executorService, long timeout, TimeUnit unit)
      Blocks until all tasks have completed execution after a shutdown request, or the timeout occurs, or the current thread is interrupted, whichever happens first.
      Parameters:
      executorService - The executor service
      timeout - the maximum time to wait
      unit - the time unit of the timeout argument