Package org.eclipse.jetty.util
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 setVirtualThreadsExecutor(Executor)
.
-
Method Summary
Modifier and TypeMethodDescriptiondefault Executor
default boolean
Deprecated, for removal: This API element is subject to removal in a future version.default void
setUseVirtualThreads
(boolean useVirtualThreads) Deprecated, for removal: This API element is subject to removal in a future version.usesetVirtualThreadsExecutor(Executor)
insteaddefault void
setVirtualThreadsExecutor
(Executor executor)
-
Method Details
-
getVirtualThreadsExecutor
- Returns:
- the
Executor
to use to execute tasks in virtual threads
-
setVirtualThreadsExecutor
- Parameters:
executor
- theExecutor
to use to execute tasks in virtual threads- Throws:
UnsupportedOperationException
- if the runtime does not support virtual threads- See Also:
-
isUseVirtualThreads
Deprecated, for removal: This API element is subject to removal in a future version.usegetVirtualThreadsExecutor()
instead- Returns:
- whether to use virtual threads
-
setUseVirtualThreads
Deprecated, for removal: This API element is subject to removal in a future version.usesetVirtualThreadsExecutor(Executor)
instead- Parameters:
useVirtualThreads
- whether to use virtual threads- Throws:
UnsupportedOperationException
- if the runtime does not support virtual threads- See Also:
-
getVirtualThreadsExecutor()
instead