Interface LoomishExecutors


public interface LoomishExecutors
Executors facade to support virtual threads.
  • Method Details

    • newCachedThreadPool

      ExecutorService newCachedThreadPool()
      Creates a thread pool that creates new threads as needed and uses virtual threads if available.
      Returns:
      the newly created thread pool
    • newFixedThreadPool

      ExecutorService newFixedThreadPool(int nThreads)
      Creates a thread pool that reuses a fixed number of threads operating off a shared unbounded queue and uses virtual threads if available
      Parameters:
      nThreads - – the number of threads in the pool
      Returns:
      the newly created thread pool
    • getScheduledExecutorService

      ScheduledExecutorService getScheduledExecutorService(int nThreads)
    • getThreadFactory

      ThreadFactory getThreadFactory()
      Returns thread factory used to create new threads
      Returns:
      thread factory used to create new threads
      See Also:
    • newThread

      Thread newThread(String name, Runnable runnable)
      Return new thread.
      Returns:
    • isVirtual

      boolean isVirtual()
      Return true if the virtual thread use is requested.
      Returns:
      whether the virtual thread use is requested.