Use new threads API

This commit is contained in:
AsamK 2023-10-17 21:56:10 +02:00
parent 8d55dfb66b
commit ed8ac5b84c
7 changed files with 40 additions and 75 deletions

View file

@ -54,7 +54,7 @@ public class HttpServerHandler {
logger.info("Starting server on " + address.toString());
final var server = HttpServer.create(address, 0);
server.setExecutor(Executors.newFixedThreadPool(10));
server.setExecutor(Executors.newCachedThreadPool());
server.createContext("/api/v1/rpc", this::handleRpcEndpoint);
server.createContext("/api/v1/events", this::handleEventsEndpoint);