public class SofaVirtualThreadFactory extends Object
| Constructor and Description |
|---|
SofaVirtualThreadFactory() |
| Modifier and Type | Method and Description |
|---|---|
static ExecutorService |
ofExecutorService(String prefix)
Creates an Executor that starts a new virtual Thread for each task.
|
static ExecutorService |
ofExecutorService(String prefix,
long start,
boolean inheritInheritableThreadLocals,
Thread.UncaughtExceptionHandler uncaughtExceptionHandler)
Creates an Executor that starts a new virtual Thread for each task.
|
static Thread |
ofThread(String name,
boolean inheritInheritableThreadLocals,
Thread.UncaughtExceptionHandler uncaughtExceptionHandler,
Runnable runnable)
Create a virtual thread with name.
|
static Thread |
ofThread(String name,
Runnable runnable)
Create a virtual thread with name.
|
public static Thread ofThread(String name, Runnable runnable)
name - thread namerunnable - task to run with threadpublic static Thread ofThread(String name, boolean inheritInheritableThreadLocals, Thread.UncaughtExceptionHandler uncaughtExceptionHandler, Runnable runnable)
name - thread nameinheritInheritableThreadLocals - true to inherit, false to not inherituncaughtExceptionHandler - uncaught exception handlerrunnable - task to run with threadpublic static ExecutorService ofExecutorService(String prefix)
prefix - thread prefixpublic static ExecutorService ofExecutorService(String prefix, long start, boolean inheritInheritableThreadLocals, Thread.UncaughtExceptionHandler uncaughtExceptionHandler)
prefix - thread prefixstart - the starting value of the counterinheritInheritableThreadLocals - true to inherit, false to not inherituncaughtExceptionHandler - uncaught exception handlerCopyright © 2024. All rights reserved.