Use a fork join pool executor with parallelism = 4

This commit is contained in:
hrj 2021-04-12 07:00:53 +05:30
parent 4612dfa1cd
commit 89eeb76c46

View File

@ -14,6 +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))
private def getRequestJson(ex: HttpExchange): JValue = {
val requestBody = ex.getRequestBody