Class VirtualThreadSupport


  • public class VirtualThreadSupport
    extends java.lang.Object
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static boolean isSupported()
      Is virtual thread supported
      static java.util.concurrent.ExecutorService newThreadPerTaskExecutor​(java.util.concurrent.ThreadFactory threadFactory)  
      static java.util.concurrent.ThreadFactory newVirtualThreadFactory​(java.lang.String prefix)
      Create a virtual thread factory with a executor, the executor will be used as the scheduler of virtual thread.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • VirtualThreadSupport

        public VirtualThreadSupport()
    • Method Detail

      • isSupported

        public static boolean isSupported()
        Is virtual thread supported
      • newVirtualThreadFactory

        public static java.util.concurrent.ThreadFactory newVirtualThreadFactory​(java.lang.String prefix)
        Create a virtual thread factory with a executor, the executor will be used as the scheduler of virtual thread.
      • newThreadPerTaskExecutor

        public static java.util.concurrent.ExecutorService newThreadPerTaskExecutor​(java.util.concurrent.ThreadFactory threadFactory)