update 使用springboot封装的虚拟线程池

This commit is contained in:
疯狂的狮子Li 2024-01-20 18:24:04 +08:00
parent 5e5fe434e2
commit 391c92a6c6

View File

@ -26,7 +26,7 @@ public class UndertowConfig implements WebServerFactoryCustomizer<UndertowServle
deploymentInfo.addServletContextAttribute("io.undertow.websockets.jsr.WebSocketDeploymentInfo", webSocketDeploymentInfo); deploymentInfo.addServletContextAttribute("io.undertow.websockets.jsr.WebSocketDeploymentInfo", webSocketDeploymentInfo);
// 使用虚拟线程 解除下方注释 仅限jdk21 // 使用虚拟线程 解除下方注释 仅限jdk21
// if (SpringUtils.isVirtual()) { // if (SpringUtils.isVirtual()) {
// ExecutorService executor = Executors.newVirtualThreadPerTaskExecutor(); // VirtualThreadTaskExecutor executor = new VirtualThreadTaskExecutor("undertow-");
// deploymentInfo.setExecutor(executor); // deploymentInfo.setExecutor(executor);
// deploymentInfo.setAsyncExecutor(executor); // deploymentInfo.setAsyncExecutor(executor);
// } // }