Package org.glassfish.tyrus.core.virtual
Interface LoomishExecutors
public interface LoomishExecutors
Executors facade to support virtual threads.-
Method Summary
Modifier and TypeMethodDescriptiongetScheduledExecutorService(int nThreads) Returns thread factory used to create new threadsbooleanReturn true if the virtual thread use is requested.Creates a thread pool that creates new threads as needed and uses virtual threads if available.newFixedThreadPool(int nThreads) Creates a thread pool that reuses a fixed number of threads operating off a shared unbounded queue and uses virtual threads if availableReturn new thread.
-
Method Details
-
newCachedThreadPool
ExecutorService newCachedThreadPool()Creates a thread pool that creates new threads as needed and uses virtual threads if available.- Returns:
- the newly created thread pool
-
newFixedThreadPool
Creates a thread pool that reuses a fixed number of threads operating off a shared unbounded queue and uses virtual threads if available- Parameters:
nThreads- – the number of threads in the pool- Returns:
- the newly created thread pool
-
getScheduledExecutorService
-
getThreadFactory
ThreadFactory getThreadFactory()Returns thread factory used to create new threads- Returns:
- thread factory used to create new threads
- See Also:
-
newThread
Return new thread.- Returns:
-
isVirtual
boolean isVirtual()Return true if the virtual thread use is requested.- Returns:
- whether the virtual thread use is requested.
-