diff options
author | 2022-11-26 01:12:33 +0100 | |
---|---|---|
committer | 2022-12-09 00:07:38 +0100 | |
commit | 5f8a34454a289ba4408d19bef5d5387c78ac36c2 (patch) | |
tree | 41dc5a121c822589cfba0db3caad99a53f006c2d /subprojects/language-web/src/main | |
parent | refactor(frontend): simplify diagnostic tracking (diff) | |
download | refinery-5f8a34454a289ba4408d19bef5d5387c78ac36c2.tar.gz refinery-5f8a34454a289ba4408d19bef5d5387c78ac36c2.tar.zst refinery-5f8a34454a289ba4408d19bef5d5387c78ac36c2.zip |
refactor: be more conservative w/preview features
Also test with virtual threads in we are using them in production.
Diffstat (limited to 'subprojects/language-web/src/main')
-rw-r--r-- | subprojects/language-web/src/main/java/tools/refinery/language/web/ServerLauncher.java | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/subprojects/language-web/src/main/java/tools/refinery/language/web/ServerLauncher.java b/subprojects/language-web/src/main/java/tools/refinery/language/web/ServerLauncher.java index 5da16850..960eef71 100644 --- a/subprojects/language-web/src/main/java/tools/refinery/language/web/ServerLauncher.java +++ b/subprojects/language-web/src/main/java/tools/refinery/language/web/ServerLauncher.java | |||
@@ -45,6 +45,7 @@ public class ServerLauncher { | |||
45 | 45 | ||
46 | public ServerLauncher(InetSocketAddress bindAddress, String[] allowedOrigins, String webSocketUrl) { | 46 | public ServerLauncher(InetSocketAddress bindAddress, String[] allowedOrigins, String webSocketUrl) { |
47 | server = new Server(bindAddress); | 47 | server = new Server(bindAddress); |
48 | enableVirtualThreads(server); | ||
48 | if (server.getThreadPool() instanceof VirtualThreads.Configurable virtualThreadsConfigurable) { | 49 | if (server.getThreadPool() instanceof VirtualThreads.Configurable virtualThreadsConfigurable) { |
49 | // Change this to setVirtualThreadsExecutor once | 50 | // Change this to setVirtualThreadsExecutor once |
50 | // https://github.com/eclipse/jetty.project/commit/83154b4ffe4767ef44981598d6c26e6a5d32e57c gets released. | 51 | // https://github.com/eclipse/jetty.project/commit/83154b4ffe4767ef44981598d6c26e6a5d32e57c gets released. |
@@ -149,6 +150,14 @@ public class ServerLauncher { | |||
149 | } | 150 | } |
150 | } | 151 | } |
151 | 152 | ||
153 | public static void enableVirtualThreads(Server server) { | ||
154 | if (server.getThreadPool() instanceof VirtualThreads.Configurable virtualThreadsConfigurable) { | ||
155 | // Change this to setVirtualThreadsExecutor once | ||
156 | // https://github.com/eclipse/jetty.project/commit/83154b4ffe4767ef44981598d6c26e6a5d32e57c gets released. | ||
157 | virtualThreadsConfigurable.setUseVirtualThreads(VirtualThreads.areSupported()); | ||
158 | } | ||
159 | } | ||
160 | |||
152 | private static String getListenAddress() { | 161 | private static String getListenAddress() { |
153 | var listenAddress = System.getenv("LISTEN_ADDRESS"); | 162 | var listenAddress = System.getenv("LISTEN_ADDRESS"); |
154 | if (listenAddress == null) { | 163 | if (listenAddress == null) { |