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 instead.
SimpleAsyncTaskExecutor#setVirtualThreads
| Modifier and Type | Field and Description |
|---|---|
| private final ThreadFactory |
| Access | Constructor and Description |
|---|---|
| public | |
| public | VirtualThreadTaskExecutor(String
the prefix for thread names (e.g. "test-") threadNamePrefix)Create a new |
| Modifier and Type | Method and Description |
|---|---|
| public void | execute(Runnable
the task)Runnable to execute (never null)Implements org. task.
|
| public final ThreadFactory |
| virtualThreadFactory | back to summary |
|---|---|
| private final ThreadFactory virtualThreadFactory | |
| VirtualThreadTaskExecutor | back to summary |
|---|---|
| public VirtualThreadTaskExecutor() Create a new | |
| VirtualThreadTaskExecutor | back to summary |
|---|---|
| public VirtualThreadTaskExecutor(String threadNamePrefix) Create a new
| |
| execute | back to summary |
|---|---|
| public void execute(Runnable task) Implements org. Doc from org. Execute the given The call might return immediately if the implementation uses an asynchronous execution strategy, or might block in the case of synchronous execution. | |
| getVirtualThreadFactory | back to summary |
|---|---|
| public final ThreadFactory getVirtualThreadFactory() Return the underlying virtual | |