Interface VirtualThreads.Configurable

All Known Implementing Classes:
DelegatingThreadPool, ExecutorThreadPool, MonitoredQueuedThreadPool, QueuedThreadPool
Enclosing class:
VirtualThreads

public static interface VirtualThreads.Configurable

Implementations of this interface can be configured to use virtual threads.

Whether virtual threads are actually used depends on whether the runtime supports virtual threads and, if the runtime supports them, whether they are configured to be used via setUseVirtualThreads(boolean).

  • Method Summary

    Modifier and Type
    Method
    Description
    default boolean
     
    default void
    setUseVirtualThreads(boolean useVirtualThreads)
     
  • Method Details

    • isUseVirtualThreads

      default boolean isUseVirtualThreads()
      Returns:
      whether to use virtual threads
    • setUseVirtualThreads

      default void setUseVirtualThreads(boolean useVirtualThreads)
      Parameters:
      useVirtualThreads - whether to use virtual threads
      Throws:
      UnsupportedOperationException - if the runtime does not support virtual threads
      See Also: