From 810691b5df3d21ab1391ca57d317a2728db175ee Mon Sep 17 00:00:00 2001 From: gssong <1742057357@qq.com> Date: 星期六, 08 六月 2024 09:22:20 +0800 Subject: [PATCH] update 优化流程办理监听,优化示例说明 --- ruoyi-common/ruoyi-common-web/src/main/java/org/dromara/common/web/config/UndertowConfig.java | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-) diff --git a/ruoyi-common/ruoyi-common-web/src/main/java/org/dromara/common/web/config/UndertowConfig.java b/ruoyi-common/ruoyi-common-web/src/main/java/org/dromara/common/web/config/UndertowConfig.java index 421ce6d..0f78928 100644 --- a/ruoyi-common/ruoyi-common-web/src/main/java/org/dromara/common/web/config/UndertowConfig.java +++ b/ruoyi-common/ruoyi-common-web/src/main/java/org/dromara/common/web/config/UndertowConfig.java @@ -2,9 +2,11 @@ import io.undertow.server.DefaultByteBufferPool; import io.undertow.websockets.jsr.WebSocketDeploymentInfo; +import org.dromara.common.core.utils.SpringUtils; import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.boot.web.embedded.undertow.UndertowServletWebServerFactory; import org.springframework.boot.web.server.WebServerFactoryCustomizer; +import org.springframework.core.task.VirtualThreadTaskExecutor; /** * Undertow 鑷畾涔夐厤缃� @@ -24,6 +26,12 @@ WebSocketDeploymentInfo webSocketDeploymentInfo = new WebSocketDeploymentInfo(); webSocketDeploymentInfo.setBuffers(new DefaultByteBufferPool(false, 512)); deploymentInfo.addServletContextAttribute("io.undertow.websockets.jsr.WebSocketDeploymentInfo", webSocketDeploymentInfo); + // 浣跨敤铏氭嫙绾跨▼ + if (SpringUtils.isVirtual()) { + VirtualThreadTaskExecutor executor = new VirtualThreadTaskExecutor("undertow-"); + deploymentInfo.setExecutor(executor); + deploymentInfo.setAsyncExecutor(executor); + } }); } -- Gitblit v1.9.3