use an unbounded thread pool
mimics the performance with JLHttpServer
This commit is contained in:
parent
fb400a6aea
commit
43e1a379ac
|
@ -14,7 +14,7 @@ class Server(port: Int) {
|
||||||
|
|
||||||
implicit val formats: DefaultFormats.type = DefaultFormats
|
implicit val formats: DefaultFormats.type = DefaultFormats
|
||||||
val server: HttpServer = HttpServer.create(new InetSocketAddress(port), 32)
|
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 = {
|
private def getRequestJson(ex: HttpExchange): JValue = {
|
||||||
val requestBody = ex.getRequestBody
|
val requestBody = ex.getRequestBody
|
||||||
|
|
Loading…
Reference in New Issue