Class VirtualThreadSupport

java.lang.Object
org.glassfish.tyrus.core.virtual.VirtualThreadSupport

public final class VirtualThreadSupport extends Object
Utility class for the virtual thread support.
  • Method Details

    • isVirtualThread

      public static boolean isVirtualThread()
      Informs whether the given Thread is virtual.
      Returns:
      true when the current thread is virtual.
    • allowVirtual

      public static LoomishExecutors allowVirtual(boolean allow, ThreadFactory threadFactory)
      Return an instance of LoomishExecutors based on a permission to use virtual threads.
      Parameters:
      allow - whether to allow virtual threads.
      threadFactory - the thread factory to be used by a the ExecutorService.
      Returns:
      the LoomishExecutors instance.