use an unbounded thread pool

mimics the performance with JLHttpServer
This commit is contained in:
hrj 2021-04-12 07:22:53 +05:30
parent fb400a6aea
commit 43e1a379ac
1 changed files with 1 additions and 1 deletions

View File

@ -14,7 +14,7 @@ class Server(port: Int) {
implicit val formats: DefaultFormats.type = DefaultFormats
val server: HttpServer = HttpServer.create(new InetSocketAddress(port), 32)
server.setExecutor(new java.util.concurrent.ForkJoinPool(Runtime.getRuntime().availableProcessors()*4))
server.setExecutor(java.util.concurrent.Executors.newCachedThreadPool())
private def getRequestJson(ex: HttpExchange): JValue = {
val requestBody = ex.getRequestBody