Skip to content

Commit 4d21839

Browse files
committed
完善 solon-server-jetty-jakarta 适配
1 parent 14197c9 commit 4d21839

File tree

1 file changed

+8
-1
lines changed
  • solon-jakarta-projects/solon-server/solon-server-jetty-jakarta/src/main/java/org/noear/solon/boot/jetty

1 file changed

+8
-1
lines changed

solon-jakarta-projects/solon-server/solon-server-jetty-jakarta/src/main/java/org/noear/solon/boot/jetty/JettyServer.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,12 @@
2121
import org.eclipse.jetty.util.thread.QueuedThreadPool;
2222
import org.eclipse.jetty.websocket.api.UpgradeRequest;
2323
import org.eclipse.jetty.websocket.server.WebSocketUpgradeHandler;
24+
import org.noear.solon.Solon;
2425
import org.noear.solon.boot.ServerLifecycle;
2526
import org.noear.solon.boot.jetty.websocket.WebSocketConfiguratorImpl;
2627
import org.noear.solon.core.event.EventBus;
2728
import org.noear.solon.core.util.ClassUtil;
29+
import org.noear.solon.core.util.ThreadsUtil;
2830

2931
import java.io.IOException;
3032

@@ -57,6 +59,11 @@ protected void setup(String host, int port) throws IOException {
5759
props.getMaxThreads(props.isIoBound()),
5860
props.getCoreThreads());
5961

62+
//支持虚拟线程池
63+
if (Solon.appIf(app -> app.cfg().isEnabledVirtualThreads())) {
64+
threadPool.setVirtualThreadsExecutor(ThreadsUtil.newVirtualThreadPerTaskExecutor());
65+
}
66+
6067
real = new Server(threadPool);
6168

6269

@@ -93,4 +100,4 @@ protected void setup(String host, int port) throws IOException {
93100
protected ServletContextHandler buildHandler() throws IOException {
94101
return getServletHandler();
95102
}
96-
}
103+
}

0 commit comments

Comments
 (0)