Class LoomSupport

java.lang.Object
io.micronaut.scheduling.LoomSupport

@Internal @NullUnmarked @Deprecated(since="5.2.1", forRemoval=true) public final class LoomSupport extends Object
Deprecated, for removal: This API element is subject to removal in a future version.
Virtual threads are always available, use Thread.ofVirtual(), Executors.newThreadPerTaskExecutor(ThreadFactory) and Thread.isVirtual() directly. To be removed, see #13119.
Virtual thread support from before virtual threads were part of every Java version Micronaut runs on.
Since:
4.0.0
  • Method Details

    • isSupported

      public static boolean isSupported()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns:
      Always true
    • checkSupported

      public static void checkSupported()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Does nothing, virtual threads are always supported.
    • newVirtualThreadFactory

      public static ThreadFactory newVirtualThreadFactory(String namePrefix, Consumer<Object> builderModifier)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Parameters:
      namePrefix - The thread name prefix, followed by a counter starting at 1
      builderModifier - Modifies the Thread.Builder.OfVirtual, may be null
      Returns:
      A factory of virtual threads
    • unstarted

      public static Thread unstarted(String name, Consumer<Object> builderModifier, Runnable task)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Parameters:
      name - The thread name
      builderModifier - Modifies the Thread.Builder.OfVirtual, may be null
      task - The task
      Returns:
      An unstarted virtual thread
    • newThreadPerTaskExecutor

      public static ExecutorService newThreadPerTaskExecutor(ThreadFactory threadFactory)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Parameters:
      threadFactory - The thread factory
      Returns:
      An executor starting a thread per task
    • newVirtualThreadFactory

      public static ThreadFactory newVirtualThreadFactory(String namePrefix)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Parameters:
      namePrefix - The thread name prefix, followed by a counter starting at 1
      Returns:
      A factory of virtual threads
    • isVirtual

      public static boolean isVirtual(Thread thread)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Parameters:
      thread - The thread
      Returns:
      Whether the thread is virtual