Class AsyncThreadService


  • public class AsyncThreadService
    extends Object
    Internal AsyncThreadService class, which wraps Java ExecutorService as static and shared between all SDK instances who needs to do async operations. Shutdown needs to be called to ensure resource release after service is not needed. According to Java documentation, by using newCachedThreadPool, ExecuteService will release the thread pool after 60 seconds if there is no active threads.
    • Constructor Detail

      • AsyncThreadService

        public AsyncThreadService()
    • Method Detail

      • initialize

        public static void initialize()
        See https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/Executors.html#newCachedThreadPool--
      • shutdown

        public static void shutdown()
        shutdown the internal thread service.
      • submit

        public static <T> Future<T> submit​(Callable<T> task)
        internal submit function.
        Type Parameters:
        T - Type of future task
        Parameters:
        task - The task to schedule
        Returns:
        The future task to wait on