类 VirtualThreadTaskExecutor
java.lang.Object
cn.taketoday.core.task.VirtualThreadTaskExecutor
- 所有已实现的接口:
AsyncTaskExecutor,TaskExecutor,Executor
A
TaskExecutor implementation based on virtual threads in JDK 21+.
The only configuration option is a thread name prefix.
For additional features such as concurrency limiting or task decoration,
consider using SimpleAsyncTaskExecutor.setVirtualThreads(boolean) instead.
- 从以下版本开始:
- 4.0
- 作者:
- Juergen Hoeller, Harry Yang
- 另请参阅:
-
字段概要
字段从接口继承的字段 cn.taketoday.core.task.AsyncTaskExecutor
TIMEOUT_IMMEDIATE, TIMEOUT_INDEFINITE -
构造器概要
构造器构造器说明Create a newVirtualThreadTaskExecutorwithout thread naming.VirtualThreadTaskExecutor(String threadNamePrefix) Create a newVirtualThreadTaskExecutorwith thread names based on the given thread name prefix followed by a counter (e.g. -
方法概要
修饰符和类型方法说明voidExecute the giventask.final ThreadFactoryReturn the underlying virtualThreadFactory.从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait从接口继承的方法 cn.taketoday.core.task.AsyncTaskExecutor
execute, submit, submit, submitCompletable, submitCompletable
-
字段详细资料
-
virtualThreadFactory
-
-
构造器详细资料
-
VirtualThreadTaskExecutor
public VirtualThreadTaskExecutor()Create a newVirtualThreadTaskExecutorwithout thread naming. -
VirtualThreadTaskExecutor
Create a newVirtualThreadTaskExecutorwith thread names based on the given thread name prefix followed by a counter (e.g. "test-0").- 参数:
threadNamePrefix- the prefix for thread names (e.g. "test-")
-
-
方法详细资料
-
getVirtualThreadFactory
Return the underlying virtualThreadFactory. Can also be used for custom thread creation elsewhere. -
execute
从接口复制的说明:TaskExecutorExecute the giventask.The call might return immediately if the implementation uses an asynchronous execution strategy, or might block in the case of synchronous execution.
- 指定者:
execute在接口中Executor- 指定者:
execute在接口中TaskExecutor- 参数:
task- theRunnableto execute (nevernull)
-